Page 1 of 1

multiple record types in a file

PostPosted: Sat Feb 16, 2008 10:37 pm
by veronikaluv
I have a file with 2 types of records both starting with 01 and 02 respectivelly.
There can be one record of the following structure> 01 FILI CONT (01 x(2) FILI X(5) CONT X(12))
with n different records with the structure> 02 CAUS IMPO (02 x(2) CAUS X (30) IMPO S9(13)V9(2) COMP-3)

How I need to define the file in FD and how to operate with it.
Thank in advance!

Re: multiple record types in a file

PostPosted: Sun Feb 17, 2008 7:06 am
by dick scherrer
Hello veronikaluv and welcome to the forum,

Code the FD as though it had only one record type. This would be the FD, a level-01 for the first recored type, and the elementary items.

Then, add a seond level-01 for the second record type and add those elementary items.

If the procedure division, read the file and if the record is an 01 process the 01 fields and if the record is an 02, process those fields.

When you have questions or something does not compile or does not work, post your question and/or any diagnostic info from the compiler or some run-time error.

Re: multiple record types in a file

PostPosted: Fri Feb 22, 2008 1:47 pm
by veronikaluv
Thanks for the reply it was very usefull.

Re: multiple record types in a file

PostPosted: Fri Feb 22, 2008 8:47 pm
by dick scherrer
You're welcome - good luck :)

d