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!
multiple record types in a file
-
- Posts: 7
- Joined: Sat Feb 16, 2008 10:26 pm
- Skillset: Beginner
- Referer: Internet
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: multiple record types in a file
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.
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.
Hope this helps,
d.sch.
d.sch.
-
- Posts: 7
- Joined: Sat Feb 16, 2008 10:26 pm
- Skillset: Beginner
- Referer: Internet
Re: multiple record types in a file
Thanks for the reply it was very usefull.
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: multiple record types in a file
You're welcome - good luck
d

d
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Create multiple records based on one record within a file.
by chillmo » Thu Aug 11, 2022 3:54 am » in Syncsort/Synctool - 5
- 7688
-
by sergeyken
View the latest post
Fri Aug 12, 2022 2:23 am
-
-
-
Extract first record from multiple files
by Prasanna G » Wed Jan 13, 2021 2:14 pm » in DFSORT/ICETOOL/ICEGENER - 5
- 1762
-
by Prasanna G
View the latest post
Wed Jan 13, 2021 11:16 pm
-
-
-
Merge multiple fixed length files of different record length
by corvette1982 » Mon Mar 01, 2021 11:46 pm » in JCL - 8
- 5294
-
by willy jensen
View the latest post
Tue Mar 02, 2021 3:02 am
-
-
- 2
- 1426
-
by Robert Sample
View the latest post
Fri Oct 22, 2021 9:41 pm
-
-
Copy partial record after a string in a record using SORT.
by Esmayeelhusen » Thu May 04, 2023 3:03 pm » in DFSORT/ICETOOL/ICEGENER - 16
- 4254
-
by Esmayeelhusen
View the latest post
Mon May 22, 2023 3:50 pm
-