If my input file contains the records, ( first five characters are KEY)
AAAAA111
AAAAA
AAAAA222
BBBBB
BBBBB444
BBBBB555
The output should be
AAAAA111
AAAAA222
BBBBB444
BBBBB555
If my input file contains the records,
AAAAA
CCCCC
CCCCC567
CCCCC789
The output should be
AAAAA
CCCCC567
CCCCC789
If my input file contains the records,
AAAAA345
CCCCC
CCCCC567
CCCCC789
The output should be
AAAAA345
CCCCC567
CCCCC789
If my input file contains the records,
CCCCC
CCCCC178
DDDDD777
The output should be
CCCCC178
DDDDD777
In brief,
If there is only one record with a given Key, irrespective of the values in the positions 6-8 , the record should go to output.
If there are multiple records with a given key, we have to check the characters in the position 6-8, if there is blank in the position 6-8 we have to ignore that record otherwise we have to move the record to output.
Can we handle this situation using a sort card, if so please help
Franks JCL is giving the correct output but in a sorted order. Frank, if i have to get the records in the same order as in the input, what changes shall i do to the JCL ?
Murali, i tried your jcl also, but it is giving me the following output
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
if i have to get the records in the same order as in the input, what changes shall i do to the JCL ?
You can use a DFSORT/ICETOOL job like this. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.