Have to apply previous record no to next record



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Have to apply previous record no to next record

Postby Hariprasad K » Wed Jun 13, 2012 4:50 pm

Hi All,

I have an unload database file, having data like below.
NAME NO DEPARTMENT
AAAA 11111111 xxxxxxxxxx
BBBB s p a ces YYYYYYYYYY
CCCC s p a ces PPPPPPPPPP
DDDD s p a ces QQQQQQQQ
AAAA 22222222 xxxxxxxxxx
BBBB s p a ces YYYYYYYYYY
CCCC s p a ces PPPPPPPPPP
DDDD s p a ces QQQQQQQQ (given " s p a ces " because of separating NAME and NO column, indicate that file having spaces at that position)
I Have to take this file as input (unload) and copy those records into another file, such that
Number filed of Name ‘AAAA’ column can be applied to all columns up to ‘DDDD’, and same process for number ‘2222222’.
After sort my output file should be:
NAME NO DEPARTMENT
AAAA 11111111 xxxxxxxxxx
BBBB 11111111 YYYYYYYYYY
DDDD 11111111 PPPPPPPPPP
DDDD 11111111 QQQQQQQQ
AAAA 22222222 xxxxxxxxxx
BBBB 22222222 YYYYYYYYYY
DDDD 22222222 PPPPPPPPPP
DDDD 22222222 QQQQQQQQ

Help me on this using dfsort/syncsort. Pleae ignore if you are not getting my requirement.
Hariprasad K
 
Posts: 19
Joined: Sat Feb 25, 2012 5:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Have to apply previous record no to next record

Postby BillyBoyo » Wed Jun 13, 2012 6:30 pm

You want to look at WHEN=GROUP with identification of 'AAAA' in col 1,4 and PUSH for 6:6,8.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Have to apply previous record no to next record

Postby Hariprasad K » Wed Jun 13, 2012 8:40 pm

Thank you Mr.Boyo for you suggestion, will try and post the same.
Hariprasad K
 
Posts: 19
Joined: Sat Feb 25, 2012 5:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Have to apply previous record no to next record

Postby BillyBoyo » Wed Jun 13, 2012 9:05 pm

Good for you. Don't forget to let us know, as the answer can help others with similar requirements in the future.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Have to apply previous record no to next record

Postby Hariprasad K » Thu Jun 14, 2012 7:36 pm

Hi Billy,
As per you I tried like below sort card and it worked
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(01,04,CH,EQ,C'AAAA'),
PUSH=(6:6,8))

Thanks for your help on this.
Hariprasad K
 
Posts: 19
Joined: Sat Feb 25, 2012 5:17 pm
Has thanked: 0 time
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post