Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a Variable Length Mainframe file by FTPing a file from AIX?

Status
Not open for further replies.

jimlocigno

Programmer
Nov 20, 2000
14
US
I have file.a on the mainframe, it is Variable Length (recfm=vb). I use FTP (binary) to get the file and put it on the unix system - call this file file.b

Then to test my theory out I ftp file.b BACK to the the mainframe system using among other things: site recfm=vb.

However, file.a (the original file on the mainframe and the file.b (the file that has been "re-ftp'd" to the mainframe) do not match. From what I can see MVS reports file.b as Recfm=vb but the record lengh for all records is the same?

Is it possible to transfer a truly variable length file from unix to MVS?

Thanks
 
I do use bin. But it seems that the mainframe still receives the file with all records being the same length. Even though querying the "properties" of the mainframe file - it says RECFM=VB (variable/blocked).

Part of me understands what is going on here, but I want to make sure I am not missing anything or overthinking this.

My Logic is:
The mainframe system uses an RDW - four bytes at the beginning of the record - that the tells the system the length of the given record. UNIX has no concept nor need for an RDW so in ftp'ing from Mainframe to UNIX the RDW is lost. Therefore without a file layout that tells how many bytes each record is (could be different for each record within the file) FTP would have NO way of "computing" the RDW when transferring from UNIX to mainframe.


If my logic is correct, then there is no way for FTP program to create a TRULY variable length file (where each record is a different length).

So, I am correct that this is impossible?

Thanks
 
I assume you do actually need to transfer from mf->unix in binary? If you do it in ASCII, it would give you proper variable length records, but that would mean EBCDIC to ASCII conversion too (something you may or may not want to happen).

IIRC, you can toggle a flag on the SITE command (or LOCSITE, depending on where the session is started from) that will allow RDWs to be send in the data from mf->unix for binary VB files. This at least gives the Unix side a decent change at processing the data, assuming you have a despoke program to read the file contents. For further info, start and FTP session from unix to mf, and enter command "quote help site" (I think! I can't get to a mainframe at present to confirm this).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top