Author: RahulG31
Subject: Reply to: Need help in reading and validating a multiline file
Posted: Tue Apr 18, 2017 9:15 pm (GMT 5.5)
Abid Hasan, I would say we use both DFSORT and COBOL program.
Step1: Use DFSORT, IFTHEN=(WHEN=GROUP with BEGIN=Header Identifier and PUSH=Header Record (or Part of header record that can uniquely identify among different headers).
OUTFIL Include=Condition you want to check with build the PUSHed header.
The output of this Step should be the Uniquely Identifiable header records for the groups that have the required condition satisfied.
Step2: Create a COBOL program that uses the Original Input file as well as the file that we got from Step1 as the Input. The first step in COBOL program is to load the file from Step1 to Internal table and then READ the Original Input file to match Header against this Internal table. If a match is found then Write to Output.
The advantage over COBOL program only solution, will be that you don't have to write and initialize table multiple times and it won't be as large a table as it could be, I suppose.
.
Subject: Reply to: Need help in reading and validating a multiline file
Posted: Tue Apr 18, 2017 9:15 pm (GMT 5.5)
Abid Hasan, I would say we use both DFSORT and COBOL program.
Step1: Use DFSORT, IFTHEN=(WHEN=GROUP with BEGIN=Header Identifier and PUSH=Header Record (or Part of header record that can uniquely identify among different headers).
OUTFIL Include=Condition you want to check with build the PUSHed header.
The output of this Step should be the Uniquely Identifiable header records for the groups that have the required condition satisfied.
Step2: Create a COBOL program that uses the Original Input file as well as the file that we got from Step1 as the Input. The first step in COBOL program is to load the file from Step1 to Internal table and then READ the Original Input file to match Header against this Internal table. If a match is found then Write to Output.
The advantage over COBOL program only solution, will be that you don't have to write and initialize table multiple times and it won't be as large a table as it could be, I suppose.
.