by MSwanberg » Mon Dec 19, 2011 5:27 pm
This sort of thing is possible, but it takes a bit of programming. Nothing too in-depth, though.
Mainframe FTP servers have what's called Mode B. (Note, I'm doing this from memory, so my syntax might not be 100% accurate). Access Mode B with the QUOTE MODE B command.
Mode B files have each record started with a x'80' followed by 2 bytes describing, in binary, the length of the record. So, a quick Perl script or VBScript program could transform the file on the PC side into a Mode B file. Read each record, get the length, and then write the record starting with x'80' and the 2-byte length.
Next, when sending the file via FTP to the mainframe, be sure to do a QUOTE SITE command to set the VB and LRECL, then do BINARY and then QUOTE MODE B. Then, when you send the file, the mainframe FTP server will interrogate each record's x'80' and 2-byte length descriptor and use that for the length of that record.
If you have any questions about Mode B, a google search will bring up plenty of information. I use this format very frequently... but I have scripts to do the heavy lifting which is why I don't know the syntax perfectly.