Page 1 of 1

Apply same number on records

PostPosted: Sat Feb 26, 2011 1:17 pm
by ranga_subham
Hi,

My input file has few records separated by '#'.

INPUT: LRECL=80, RECFM=FB
100200
200300
#
100002
200003
#
300400
400500
#
500600
600700


I want a same number applied on the records fall between '#' symbol.

OUTPUT:
100200         
200300
#
100002         0001
200003         0001
#
300400         0001
400500         0001
#
500600
600700


Can you please help me it with Syncsort.

Thanks.

Re: Apply same number on records

PostPosted: Tue Mar 01, 2011 4:06 pm
by ranga_subham
Tried this code but with not much success :(

//SYSIN    DD *                                                     
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'#'),PUSH=(10:ID=3)),
        IFTHEN=(WHEN=(1,4,CH,EQ,C'#'),OVERLAY=(10:C'   ')),       
        IFTHEN=(WHEN=(10,3,ZD,EQ,NUM),OVERLAY=(10:C'001'))           
  SORT FIELDS=COPY                                                   


Thanks.