How to FTP a file from VB to the MVS mainframe specifing the record length

haleycsi

New member
Joined
Sep 20, 2007
Messages
1
Programming Experience
10+
The following code gets the file to the Mainframe but in the 80 byte LREC format, I need it to land in 11 bytes (Site command?) can anyone help? I have used third party products but perfer to stay in VB or use WS_FTP if VB can not do it. This is a Console application.
Thank you, Alan (Lunch for the solution)

VB.NET:
Dim b() As Byte
Dim ftp As System.Net.FtpWebRequest = _
CType(FtpWebRequest.Create(URI), FtpWebRequest)

ftp.Credentials = New System.Net.NetworkCredential(logonID, password)
ftp.UseBinary = False
ftp.Method = System.Net.WebRequestMethods.Ftp.UploadFile
ftp.UsePassive() = True
Dim Stream As StreamReader = New StreamReader(vendorFileName1, _
    System.Text.Encoding.ASCII, False)

b = Encoding.Default.GetBytes(Stream.ReadToEnd())
ftp.ContentLength = b.Length

Dim requestStream As Stream = ftp.GetRequestStream()
 
Last edited by a moderator:
FTP to mainframe

How do you specify the URI for a mainframe dataset? Also, did you figure out how to change the site settings? (LRECL etc..)
 
Back
Top