I've got a MVS mainframe file that has been FTPed to our Solaris system. The records are variable and contain packed decimal and binary data so I've got to do any EBCDIC/ASCII conversion field by field, also I can't rely on the end of record being marked by line feed in the usual Unix fashion. Each record is preceded by a 4-byte record length field (RDW in mainframe terminology). I'm using Fujitsu COBOL and have coded -
01 in-record.
02 in-rdw pic 9(4) comp.
02 filler pic xx.
02 in-data pic x occurs nnn to nnn depending on in-rdw.
The record length (in binary) seems to be in first 2 bytes of the prefix field. Field in-rdw contains the length of in-data PLUS 4. So the system reads in the first record OK plus the first 4 bytes of the second record, hence all subsequent records are garbage. Anybody else had this problem? [sig][/sig]
01 in-record.
02 in-rdw pic 9(4) comp.
02 filler pic xx.
02 in-data pic x occurs nnn to nnn depending on in-rdw.
The record length (in binary) seems to be in first 2 bytes of the prefix field. Field in-rdw contains the length of in-data PLUS 4. So the system reads in the first record OK plus the first 4 bytes of the second record, hence all subsequent records are garbage. Anybody else had this problem? [sig][/sig]