Page 1 of 1

SORT: Inserting Previous row Data into the Succeding Row

PostPosted: Thu Jul 30, 2015 9:48 pm
by kevin_chuchi
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

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

PostPosted: Fri Jul 31, 2015 2:35 am
by NicC
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).

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

PostPosted: Fri Jul 31, 2015 1:28 pm
by BillyBoyo
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).