The first pass gets you two files. T1 will have first record in a set of duplicates (or, the only record in case of no duplicates) and T2 will have other duplicates. These files are 'tagged' with A and B respectively.
The second pass creates the report. Here, control break is implemented on 1,3,CH. For every break, I am writing the very record that caused the break as the header (HEADER3). HEADER2 gets you the column headers.
If only the second pass were present (as a SORT step) you would have got the HEADER3 record as a data record also. That is why the first pass is needed. The third pass, therefore, keeps only those records which are not in HEADER3 already.
Hope this helps... _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Thu Jun 03, 2004 6:30 am Post subject:
hypertech,
The below JCL is another alternative for getting the desired results. A brief explanation of the job. I assumed that your input is 80 bytes and of fb recfm
We first format the input record using inrec. We code spaces in the first 3 bytes and we pad the key at the end of the every record. so now the first bytes are spaces for all records and the 81 st position will have the key. Now we sort on the key at 81st position and eliminate dupes. the eliminated dups will be written to CTL1XSUM dataset.now using outrec we write the key in the first position for the first record.
The second sort operator concates these 2 files and once again sorts on the key at 81st position to retain the sequence.
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Thu Jun 03, 2004 6:48 am Post subject:
The following Job would also give the desired results. our shop has only syncsort and I cannot test this job. So I would appreciate if anyone with dfsort can test this job and post if it works
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
Posted: Thu Jun 03, 2004 9:00 am Post subject:
Yes, it works fine.
Just one small thing, Kolusu. In the orignal post by hypertech, he mentions HEADER2. So, maybe, you must use HEADER2 instead of HEADER1. _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Thu Jun 03, 2004 6:46 pm Post subject:
Thanks cogito,
Edited the posts to add the IN DD * statement. I must have missed in the cut & paste. Well I hate guessing , but can't help it as most of the posters do not provide the right information.
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