SORT: Inserting Previous row Data into the Succeding Row



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

SORT: Inserting Previous row Data into the Succeding Row

Postby kevin_chuchi » Thu Jul 30, 2015 9:48 pm

Is this possible to achieve this following transformation using Syncsort or DFSORT ?

EDOOO row can be followed by either by single BC1000 or both BC1000 and BC2000.

Input
ED0000 XXXXX
BC1000
BC2000
ED0000 YYYYYY
BC1000
ED0000 ZZZZZ
BC1000
ED0000 AAAAA

Expected Output
ED0000 XXXXX
BC1000 XXXXX
BC2000 XXXXX
ED0000 YYYYYY
BC1000 YYYYYY
ED0000 ZZZZZ
BC1000 ZZZZZ
ED0000 AAAAA
kevin_chuchi
 
Posts: 1
Joined: Thu Jul 30, 2015 9:37 pm
Has thanked: 1 time
Been thanked: 0 time

Re: SORT: Inserting Previous row Data into the Succeding Row

 

Re: SORT: Inserting Previous row Data into the Succeding Row

Postby NicC » Fri Jul 31, 2015 2:35 am

Well, which of those sort products does your site use? And if you are wanting a sort solution why post in the JCL forum? Moving to DFSort forum (for now).
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

These users thanked the author NicC for the post:
kevin_chuchi (Fri Jul 31, 2015 7:18 am)
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: SORT: Inserting Previous row Data into the Succeding Row

Postby BillyBoyo » Fri Jul 31, 2015 1:28 pm

Use IFTHEN=(WHEN=GROUP with BEGIN for your key value then PUSH the data you want to the position you want (looks like PUSH=(8:8,6) with being your maximum length).
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post