Posted: Tue May 31, 2005 7:16 am Post subject: eliminate selected record in two files
Hi all
I have a requirement like this
I have two input files check file and autopay file. I have to concatenate both these files and sort on contract number (it's location is 15 length is 9 in ascending order) and write it back to check file.
Case 1:-
Check file contains contracts and Autopay file contains record as "NO PAYMENTS FOUND." (may be one or more than one records) in this case I need only contract numbers not "NO PAYMENTS FOUND." message in output.
Case 2:-
Check file contains record as "NO PAYMENTS FOUND." (may be one or more than one records) and Autopay file contains contract records in this case I need only contract numbers not "NO PAYMENTS FOUND." message in output.
Case 3:-
Check file contains "NO PAYMENTS FOUND." (may be one or more than one records) and Autopay file contains record as "NO PAYMENTS FOUND." (may be one or more than one records) in this case I need only one "NO PAYMENTS FOUND." record in my output
Case 4:-
Check file contains contracts and Autopay file contains contracts in this
case I need all contract numbers in my output
In my shop I have Syncsort. DCB parameters for both file are LRECL=315,RECFM=FB. _________________ Regards,
Chandra
Brief Explanation of the job
1. Concatenate both the input files in the order - Autopay -> Check File.
2. Create a dynamic sort card CTL2CNTL in Step 1.
a. Reject all "No Payments Found" record from the concatenated files (no matter in which file/how many occurences are there).
b. Just process 1 record (OUTFIL ENDREC=1). If there is a DATA record left in the input, a dynamic sort card will be created as shown below. See the OUTREC parameter in OUTFIL.
Code:
INCLUDE COND=(1,18,CH,NE,C'NO PAYMENTS FOUND.')
END
c. If no DATA records are available (Case 3) then no records will be written to the dynamic control card CTL2CNTL. In this case, sort will pickup the Hardcoded instream control card concatenated to CTL2CNTL.
For Case 1, 2 & 4, the CNTL2CNTL will actually be
Code:
INCLUDE COND=(1,18,CH,NE,C'NO PAYMENTS FOUND.')
END
OUTFIL ENDREC=1,
OUTREC=(C'NO PAYMENTS FOUND.',80:X)
END
The END statement makes sure that the second half of the control card is not taken for processing.
Your solution is not working for case 2 and the length field in INCLUDE COND in CTL1 is not correct. I have corrected but still I am not getting can you please help me out.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum