My requirement is to sum the ZD from position 16 to 20, when the the keys from position 1 to 5 and from 6 to 10 are same.
When the value from position 6 to 10 is '99999', we need to check the values from position 11 to 15. Only when the values from position 11 to 15 are equal, we sum the fields.
When the value from position 6 to 10 is '99999', and the values from position 11 to 15 are not equal, we dont' sum the fields.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Fri Sep 24, 2004 5:31 pm Post subject:
Arian,
Quote:
Guys..especially Kolusu...is tis so tough for u guys to break...umm...i realy have a good posting then..
It ain't tough, just was busy at work , that I did not even have a chance to look at the helpboards all day today. I just got back home. So the following JCL will give you desired results.
I assumed that your input file is LRECL=80 & RECFM=FB.
A brief explanation of the job. The first copy operator takes in the input file and using a change command on the INREC , we add a identifier at 81st byte.
If the pos 6 has '99999', then 81st byte will have 1 , for all other records we have '0'
Now using another change command on the OUTREC, we validate the 81st byte. If the 81st byte has '0'(which means it is not a 99999 records) , we add a identifier '00000' at 82nd byte. for all other records(means the 99999 records) , we populate with the contents from 11 thru 5 and written to temp file T1.
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