The above given input file has total number of detail records count given in header at 12th column followed by no. of details records. It is evident that the total count between header and no. of detail records does not match in first set of records.
Would you please let me know how to split good sets of records into one output file and bad set of records into another output file after comparing the count in header and no.of detail records?
Thanks. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Kolusu, I thought it takes some time for me to understand this solution though it has given me desired result
Would you please let me know why to use SORTED,NOSEQCK on first file alone !?
Thanks a lot. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Sep 16, 2010 12:32 pm Post subject:
mf_user wrote:
Kolusu, I thought it takes some time for me to understand this solution though it has given me desired result
Would you please let me know why to use SORTED,NOSEQCK on first file alone !?
Thanks a lot.
The solution is quite simple
1. Using When=group keyword we number the groups and we know that it is already in the sequence since we are generating the ID using PUSH in pos 86. This is how the data looks like from JNF1CNTL. The key we are using to sort is in pos 86 which is already in the sorted order. So we don't need to sort it. SORTED,NOSEQCK will override the sort statement of JNF1 with a COPY statement.
but for the second file we are just getting 1 record per group. before the sum statement this is how the records look. For the sum to work we need a sort statement.
after the sum statement , the records looks like this
Code:
IND CONST ID
1-3 4-8 9-16
=== ===== ========
HDR 00004 00000001
HDR 00006 00000002
HDR 00005 00000003
Now the match is done on the id from both files and the no:of details records is tagged at the end of file1 record and compared on OUTFIL with INCLUDE _________________ Kolusu
www.linkedin.com/in/kolusu
Thanks a lot for the detail explanation. It is lot helpful. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
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