Software Archive
Read-only legacy content
17061 Discussions

Reading IBM mainframe generated unformated files on a PC

Intel_C_Intel
Employee
702 Views
I'm trying to read an unformated file that was created on an IBM mainframe with variable block spanning (VBS), but I get "forrtl: severe (22): input record too long ..." no matter what I set BLOCKSIZE= or RECL= to. (By the way, the file was created with RECL=32756 & BLOCKSIZE=27998.) This doesn't seem to have anything to do with CONVERT='IBM' option. Anybody have any ideas on how I can work around this file read error?
Thanks, Don
0 Kudos
3 Replies
Steven_L_Intel1
Employee
702 Views
Have you tried RECORDTYPE='FIXED'? If the file was created with all recrords the same length, that's what you'd want. You will probably also want to specify the /assume:byterecl option (under Fortran Data - RECL for unformatted files is in bytes).

If you can't figure it out, and you know what the data is supposed to look like, send a ZIP file of the data file and the record layout to us at vf-support@compaq.com and we'll see what we can do. Please use a ZIP file and don't just attach the files directly to the message.

Steve
0 Kudos
Intel_C_Intel
Employee
702 Views
Thanks Steve. I tried your suggestion and got the first record correctly, but not the others. Then I read the help information for RECORDTYPE and decided to try ='STREAM' and it worked for the all records in the file. (At least as far as I can tell so far.) 'FIXED' caused the READ to pick up too much data and go into the second record. I think 'STREAM' worked because the IBM file was written with variable block spanning (VBS). Again, thanks for your help. I already like CVF, now I like the tech support too.
0 Kudos
Steven_L_Intel1
Employee
702 Views
Yes, I can see why STREAM may have worked in this case. Glad to hear you got it working, and that you like our product and support.

Steve
0 Kudos
Reply