There is a requirement where i am trying to pull the segments present in IMS database on the few conditions, and has to be formatted in the required format. All the segments it is pulling up correctly, however there is an requirement where all the fields have to be formatted as per one file layout, where in one field is having three occurrences, below is the sample sort card with the expected outcome and the output i got.
Please help me with the sort card.
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
Please post in therelevant section of the forum - you have a sort problem, not an IMS problem. Topic moved. (If you have Syncsort then let us know and it will be moved to that forum.)
When presenting code, data, control statements please use the Code button in the Reply editor.
You do not understand the idea of grouping records while sorting.
First of all, in your case you need to use WHEN=GROUP,KEYBEGIN=(1,2),PUSH=(48:SEQ=2) to differentiate between sequential lines within the same group, like multiple '07's numbered as '01', '02', '03'...
Next, you may need some sophisticated IFTHEN=(WHEN=…), but initially you need to read carefully about GROUP in SORT.
Thanks for your response.
My bad, I should have kept the title correctly.
Nick,
I have tried putting sequence number to differentiate the repetitive record, having multiple values, however the main challenge over here is to write all the pushed record in a single rows i. e in the last row and then by putting include condition get the last row to proceed further, where it has to be written as per file layout.