Page 1 of 1

syncsort

PostPosted: Mon Nov 28, 2011 5:09 pm
by meena
hi all,
can we delete adjacent duplicate records by syncsort..i have a file after processing thru many codes like below....
my ip file ll contain
11111111111110001
11111111111110001
12121212121210001
22222222222220002
23232323232320002
55555555555550003
55555555555550003
56565656565650003
33333333333330004
where 0001,0002 are sequence nos introduced while proceesing.

my op file shld contain:
1111111111111
1212121212121
2222222222222
2323232323232
5555555555555
5656565656565
3333333333333

i need to delete the adjacent duplicates and copy only the data not the sequence no...

kindly suggest a soln

Re: syncsort

PostPosted: Tue Dec 06, 2011 4:16 am
by Alissa Margulies
Here is one way to achieve the desired output:
//STEP1 EXEC PGM=SORT   
//SYSOUT  DD SYSOUT=*
//SORTIN  DD *
11111111111110001
11111111111110001
12121212121210001
22222222222220002
23232323232320002 
55555555555550003
55555555555550003
56565656565650003
33333333333330004   
//SORTOUT DD DISP=(NEW,PASS),DSN=&&TEMP,SPACE=(TRK,1),UNIT=SYSDA
//SYSIN   DD * 
  INREC OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,13)) 
  SORT FIELDS=COPY
/*
//STEP2 EXEC PGM=SORT
//SORTIN  DD DISP=SHR,DSN=&&TEMP
//SORTOUT DD SYSOUT=*
//SYSOUT  DD SYSOUT=*   
//SYSIN   DD * 
  INCLUDE COND=(81,8,ZD,EQ,1)
  INREC BUILD=(1,13)
  SORT FIELDS=COPY 
/*           


Regards,