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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

header in variable length file 2

Status
Not open for further replies.

snuv

Programmer
Oct 30, 2001
751
GB
Can anyone tell me what the first 128 (132?) bytes in a variable length file or point me at some documentation that would help

ie all the data before the first record starts

Thanks in advance

Go not to cats for advice for they will just walk over the keyboard
 
The 128 bytes you are talking about could be anything depending on what platform your are on, which compiler you are using and exactly how your variable length file was defined (ie: sequential, line sequential, indexed etc.)

I do not believe anyone can answer your questions without knowing more detail about your file. Additionally, Vendors of PC compilers are not known for giving out what all the extra control characters in various file types really stand for. I think they expect you to use their utilities and programs to read these files.

As a general rule, variable length line sequential files do not have any of these control bytes included in the file. Just the standard x'0D0A' to indicate the end of line.

In the IBM mainframe, what goes in front of a variable length records is a block length in binary followed by a binary record length in front of each record.

etom
As you can see, it is not an easy answer without many more details.
 
snuv -

Can't answer this without information about your compiler/platform.

Here's one description of how this is handled on one platform:

"IBM mainframes ... A record descriptor word or RDW precedes each variable length record. The RDW is a four-byte field. The first two bytes are an unsigned integer representing the length of the record including the RDW. The allowable range for an RDW is 4 to 32,767. The last two bytes are, by convention, binary zeros or EBCDIC spaces. In complex data sets the last two bytes are used to span records over two or more physical records. To conserve disk or tape space, applications block logical records into physical records. A Block Descriptor Word or BDW precedes each block. It has exactly the same format as the RDW."

Regards.

Glenn
 
Please bear with me, I'm a C++ programmer trying to help out a mainframe programmer. I guess I dont know how much I dont know yet

The file in question is a variable length sequential file
The compiler is NetExpress v3
The program is on a Windows NT platform

Thanks for this


Go not to cats for advice for they will just walk over the keyboard
 
The format of the header record is in the System Reference manual. If you don't have access to this manual, I probably could find mine and transcribe the info.
 
Just so you understand, if you are trying to "help out a mainframe programmer" - the header information in a MAINFRAME variable length sequential file is VERY different from the header information in a NetExpress variable length sequential file.

Why does your "mainframe programmer" WANT to know this information for a NetExpress environment? If they are trying to "emulate" the mainframe environment on a PC, then they should be looking (IMHO) at "Mainframe Express" and NOT "Net Express". If he is trying to PORT a mainframe application to the PC, then other issues apply.

Bill Klein
 
snuv,

A good place to start would be:
What are you trying to accomplish?​
This forum is very good at taking a problem to a solution...when we know the problem. [smile]

Tom Morrison
 
The problem appears to have been resolved although I'm not sure how.

The original problem was ...
We have two systems, one of which can take the output from the other in a variable length sequential file.

The second system was being implemented at a client site, and they were attempting to import their historical data (dont know the format but it wasnt compatible)

A consultant managed to convert their data files using SAS but this didnt include the RDW or the 128 byte header. When I looked at a correctly formated data file in a hex editor and saw the header, I asked what it was and no-one knew what it contained, so I posted the question.

WebRabbit
Thanks for your offer. I will check our copy of the manual and if it isn't available, I will ask the powers that be why it isn't available :)

Again thanks all for your help


Go not to cats for advice for they will just walk over the keyboard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top