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.
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.
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.