Joined: 30 Sep 2014
Location: South Africa
| 0 votes |
| 0 salutes ||
|Posted: Tue Sep 30, 2014 2:06 pm Post subject: writing 2 records for each qualifying input record.
I have a DFSORT that sorts, filters, and then builds an output record.
I need a 2nd (slightly different) record to also be written for each qualifying record (to the same DD preferably).
So far I cannot get it to work, and find no similar examples.
My last resort would be a completely seperate DFSORT step just to create the 2nd record, followed by another sort to merge the 2 files back into one. Not very elegant so I hope you can help!
Snippet from the example is below: (sorry I cannot get the formatting to show correctly)
SORT FIELDS=(77,8,PD,A, -
030:%02,CHANGE=(8,C' ',C'IN'), -
051:C' ', -
097:C' ', -
101:C' ', -
151:C' ', -
544:C' ', -
554:C' ', -
Joined: 24 May 2012
| 1 votes |
| 1 salutes ||
|Posted: Tue Sep 30, 2014 4:47 pm Post subject:
|It can be done in one step using ICETOOL (two SORT operators, with USING for the first one to contain you existing code and then you'll need the new SUM) but I don't really regard it as elegant, because if the second operator fails, you have to re-do the first for no other reason than having to.
It could also be done with JOINKEYS. Convenient if you needed JOINKEYS, because you can do a SORT in the Main Task. But without needing the JOINKEYS, not so elegant.
If you search the DFSORT manual for "slash" you should find the documentation. It is in the description of the OUTFIL reporting functions, from memory.