For Programmers: Free Programming Magazines  


Home > Archive > Cobol > December 2007 > Parsing old MF data files - Record Headers and...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Parsing old MF data files - Record Headers and...
Will

2007-12-15, 6:56 pm

2 questions at the end of this update and setup...

I've downloaded ParseRat and seem to be making progress on getting the data
out of this old COBOL / DOS 6.2 application. The application seems to have
been created with Micro Focus COBOL/2 Version 1.2.29 L2.2 revision 003

According to a previous post by Richard...
The first 128 bytes of the data files are 'file headers' ... and then each
record has a 2 byte 'record header'
- That seems to agree with what I'm seeing.

And Richard said... the if the first 4 bits of the 'record header' are 0100
then it is a 'user record'
- That seems true too as all of the records in Owners.FIL are preceeded with
Hex 41 B7 (1st byte = 41hex and 2nd byte = B7hex)

- If I tell ParseRat that the first 128 bytes are file header... and define
the total record length in bytes... then all fields line up vertically...
all Lname fields, all Fname fields, all Date fields, etc...
- And every record begins with 41hex and B7hex... then the first field
defined in the Copybook file starts.
- Every field seems to match the length defined in the associated copybook
file.

QUESTION 1 - Is it safe to assume that all records who's 1st 4 bits are 0100
are 'user records' that are active and not 'deleted' records? If no how do I
tell?
QUESTION 2 - There is some data tagged on the end of each record... and
often it is just blank... but down the list of records I start seeing... NNI
or MOS or LBE or MAN or NDR or ORA or REG.
Anybody have any idea what this may mean??? Maybe that is telling me the
status of the record? I don't know.

I've actually be able to export the data as comma delimited data... and then
been able to import into Microsoft Access as a new table... I'm ready to do
all the data files but first I want to make sure I'm understanding the file
formats correctly.

Thanks everyone for pitching in here. Very helpful to a guy who has never
done COBOL before. (And I'm sure it shows :)



Rick Smith

2007-12-15, 6:56 pm


"Will" <Will@somewhere.com> wrote in message
news:476410e9$0$28874$4c368faf@roadrunne
r.com...
> 2 questions at the end of this update and setup...

[snip]
> QUESTION 1 - Is it safe to assume that all records who's 1st 4 bits are

0100
> are 'user records' that are active and not 'deleted' records? If no how do

I
> tell?


Yes. Deleted records are 0010. Note that 0101 thru 1000 are
also user records or pointers to user records; but I've never
seen them in a file and do not know under what conditions they
are generated. (Possibly for record lengths > 4K)

> QUESTION 2 - There is some data tagged on the end of each record... and
> often it is just blank... but down the list of records I start seeing...

NNI
> or MOS or LBE or MAN or NDR or ORA or REG.
> Anybody have any idea what this may mean??? Maybe that is telling me the
> status of the record? I don't know.


As was mentioned previously, physical data records are a multiple
of 4 bytes in length. 439 (x"01B7") + 2 = 441, 444 is the next multiple.
The three characters are fillers and should be ignored.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com