Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Mon Jul 06, 2009 2:22 pm Post subject:
Ronb,
Yes it would give the desired results. For some reason I interpreted that 3rd byte is the driving factor in sorting. I guess we have to wait for OP to come up with the exact rules. _________________ Kolusu
www.linkedin.com/in/kolusu
Using both sort cards, I got the desired output for the above sample data. However, Ronb solution didn't worked for another sample test data (mentioned below).
09
08FN
07
10F
01 N
05
04F
06 N
02FN
03F
I got the required output using Kolusu's solution for the above sample data also.
Kolusu,
Could you please explain in detail about the solution which you have provided. This will help me in understanding the sort functionality.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Tue Jul 07, 2009 10:06 am Post subject:
anandmsteds,
It would have been nice if you explained the rules for sorting. Luckily my guess was correct but in future make sure to explain the requirement in detail
Anyway here is an explanation of the control cards
Code:
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'00')),
This statement will put 2 zeros in pos 81.
Code:
IFTHEN=(WHEN=(3,2,CH,EQ,C' '),OVERLAY=(81:C'9')),
when pos 3 for 2 bytes has spaces we overlay a value of 9 in pos 81
Code:
IFTHEN=(WHEN=(4,1,CH,EQ,C' '),OVERLAY=(82:C'9'))
when pos 4 for 1 bytes has spaces we overlay a value of 9 in pos 82
Now we sort on the indicator at pos 81 first so that all the records that have 2 spaces in pos 3 are pushed to the bottom. Then we sort on pos 3 and then followed again pos 82 which takes care of the 4th byte space records and then finally by the first 2 bytes. _________________ Kolusu
www.linkedin.com/in/kolusu
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