Attempting to read variable length records as raw data 
Author Message
 Attempting to read variable length records as raw data

I've got 3490 EBCDIC tapes that were produced on an IBM S/390
box.

The language that created them is COBOL, and the layout shows
multiple "occurs" fields at the end of the record.

I'm told that these are variable length records, and if the
tailend occurs fields are not used, then they won't be stored
on tape.

Looking at the tape shows be the 1st record starts with
3E 26 00 00 02 DF 00 00 and then the actual data (I think),
and then all other records have a 4 byte prefix which seems
to vary.

02 DF 00 00 seems common, as it 97 60 00 00 and others.
The record size is LRECL (max, I guess) of 7261, but it
should be a minimum of 277 (which is the end of the last
non-occurs field).

Doing a "big-endian" unsigned 16 bit dump of the 02 DF
gives me 735, which is 40 bytes into the next record so
that can't be right.

Is there any reference that can show me how to dump this
data?

Thanks.

Please email, as well as post, and I will summarize.

Thanks.

Barry



Thu, 30 Sep 2004 02:33:03 GMT  
 Attempting to read variable length records as raw data
It would help us if you could show us the JCL that created the tape file.
For the moment, I will assume that it is a VB (Variable blocked) format
file.  If so, there is a "block descriptor word" at the beginning of each
block and then a record descriptor word at the beginning of each record.
(This would explain the 1st record's prefix being "different" from later
ones - at least until you reach the next block).

Can you tell us what operating system and "tools" you are using to "dump"
this file?  If you have COBOL on the "receiving system" - the chances are
that this would be your easiest method of reading the file.

I think that before anyone can tell you exactly how to "interpret" your
file, we will need to know more about how it was created and where/how you
are trying to "dump" it.

--
Bill Klein
 wmklein <at> ix.netcom.com

Quote:
> I've got 3490 EBCDIC tapes that were produced on an IBM S/390
> box.

> The language that created them is COBOL, and the layout shows
> multiple "occurs" fields at the end of the record.

> I'm told that these are variable length records, and if the
> tailend occurs fields are not used, then they won't be stored
> on tape.

> Looking at the tape shows be the 1st record starts with
> 3E 26 00 00 02 DF 00 00 and then the actual data (I think),
> and then all other records have a 4 byte prefix which seems
> to vary.

> 02 DF 00 00 seems common, as it 97 60 00 00 and others.
> The record size is LRECL (max, I guess) of 7261, but it
> should be a minimum of 277 (which is the end of the last
> non-occurs field).

> Doing a "big-endian" unsigned 16 bit dump of the 02 DF
> gives me 735, which is 40 bytes into the next record so
> that can't be right.

> Is there any reference that can show me how to dump this
> data?

> Thanks.

> Please email, as well as post, and I will summarize.

> Thanks.

> Barry



Thu, 30 Sep 2004 07:21:44 GMT  
 Attempting to read variable length records as raw data

Quote:

> I've got 3490 EBCDIC tapes that were produced on an IBM S/390
> box.

> The language that created them is COBOL, and the layout shows
> multiple "occurs" fields at the end of the record.

> I'm told that these are variable length records, and if the
> tailend occurs fields are not used, then they won't be stored
> on tape.

> Looking at the tape shows be the 1st record starts with
> 3E 26 00 00 02 DF 00 00 and then the actual data (I think),
> and then all other records have a 4 byte prefix which seems
> to vary.

> 02 DF 00 00 seems common, as it 97 60 00 00 and others.
> The record size is LRECL (max, I guess) of 7261, but it
> should be a minimum of 277 (which is the end of the last
> non-occurs field).

> Doing a "big-endian" unsigned 16 bit dump of the 02 DF
> gives me 735, which is 40 bytes into the next record so
> that can't be right.

The language isn't the determining factor on IBM mf's, it's a function
of the access method. This looks like straightforward VB QSAM. The
length of records is stored by QSAM as LLbb, i.e., a 2-byte binary
length followed by the "bb" field, typically binary zeroes, called a
Record Descriptor Word (RDW). The "LL" includes the length of the RDW.

A block of VB data looks like:

RDW = block length, so this block is 15,910 bytes long (max LRECL is
probably something like 16,000 or 16,384.
The first logical record begins at the 5th byte and is 735 bytes long.
Its RDW is located at start of block +4 bytes.

The 2nd logical record is located at the beginning of the block+4+735,
and so on. This logical record contains 731 bytes of data.

(offsets are relative to one)

HTH



Thu, 30 Sep 2004 15:13:32 GMT  
 Attempting to read variable length records as raw data

Quote:

> I've got 3490 EBCDIC tapes that were produced on an IBM S/390
> box.

> The language that created them is COBOL, and the layout shows
> multiple "occurs" fields at the end of the record.

> I'm told that these are variable length records, and if the
> tailend occurs fields are not used, then they won't be stored
> on tape.

> Looking at the tape shows be the 1st record starts with
> 3E 26 00 00 02 DF 00 00 and then the actual data (I think),
> and then all other records have a 4 byte prefix which seems
> to vary.

> 02 DF 00 00 seems common, as it 97 60 00 00 and others.
> The record size is LRECL (max, I guess) of 7261, but it
> should be a minimum of 277 (which is the end of the last
> non-occurs field).

> Doing a "big-endian" unsigned 16 bit dump of the 02 DF
> gives me 735, which is 40 bytes into the next record so
> that can't be right.

The language isn't the determining factor on IBM mf's, it's a function
of the access method. This looks like straightforward VB QSAM. The
length of records is stored by QSAM as LLbb, i.e., a 2-byte binary
length followed by the "bb" field, typically binary zeroes, called a
Record Descriptor Word (RDW). The "LL" includes the length of the RDW.

A block of VB data looks like:

RDW = block length, so this block is 15,910 bytes long (max LRECL is
probably something like 16,000 or 16,384.
The first logical record begins at the 5th byte and is 735 bytes long.
Its RDW is located at start of block +4 bytes.

The 2nd logical record is located at the beginning of the block+4+735,
and so on. This logical record contains 731 bytes of data.

(offsets are relative to one)

HTH



Thu, 30 Sep 2004 15:13:45 GMT  
 Attempting to read variable length records as raw data
Hi Barry,

You don't mention what environment you plan to use this data in or what you
intend to do to it. So I'll assume you don't have mainframe or COBOL resources
at your disposal.

If you have the capabilty of reading the data  a block at a time, you can use
the info Liam provided to loop thru the block and extract the individual
records.

The remaining problem you face is the tables at the end of the recs (the
multiple occurs). If you provide a copy of the record layout, that may provide
some clues.

Regards, Jack.      



Fri, 01 Oct 2004 12:37:19 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Variable length raw-byte data

2. Reading variable-length records from a file

3. Variable length records (How to define/read)

4. How to read a binary file with variable length record

5. Reading variable length records...

6. Getting true length of a variable length record - IBM Mainframe

7. Finding Variable-Length Record Length

8. Processing variable length/variable data files

9. Error 530 (Possible Data Corruption in file attempting to access a record)

10. Using DEC Fortran to read raw binary data?

11. How can I read raw floating point data?

12. ? Read in raw data

 

 
Powered by phpBB® Forum Software