IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Syncsort - Remove duplicates in a csv file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Sun Jun 12, 2011 1:53 pm
Reply with quote

For two records for which you want to see one excluded, edit them in hexadecimal, then verify there is not somewhere a non-printable code byte ( less than '40'x ).
Back to top
View user's profile Send private message
mksranjani

New User


Joined: 03 Feb 2010
Posts: 29
Location: Chennai

PostPosted: Mon Jun 13, 2011 12:48 pm
Reply with quote

Hi Enrico,

In the code you have given , could you please explain me the INREC and SORT FIELDS statements.
have given below the code for your reference..

000045 //CTL1CNTL DD *
000046 INREC OVERLAY=(81:SEQNUM,8,ZD)
000047 SORT FIELDS=(1,80,CH,A,81,8,ZD,A)
000048 OUTREC BUILD=(1,88)
000049 //CTL2CNTL DD *
000050 SORT FIELDS=(81,8,ZD,A)
000051 INREC IFTHEN=(WHEN=INIT,OVERLAY=(89:SEQNUM,8,ZD,RESTART=(1,80)))
000052 OUTFIL INCLUDE=(89,8,ZD,EQ,1),BUILD=(1,80)
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Jun 13, 2011 1:08 pm
Reply with quote

the inrec and the sort statements of the first pass
apply a sequence number to the original dataset and sort on the whole thing

bbbbbb...
bbbbbb...
aaaaaa...
aaaaaa...
bbbbbb...
bbbbbb...


bbbbbb...1
bbbbbb...2
aaaaaa...3
aaaaaa...4
bbbbbb...5
bbbbbb...6


aaaaaa...3
aaaaaa...4
bbbbbb...1
bbbbbb...2
bbbbbb...5
bbbbbb...6



the second inrec applies a record in the block sequence number


aaaaaa...3...1
aaaaaa...4...2
bbbbbb...1...1
bbbbbb...2...2
bbbbbb...5...3
bbbbbb...6...4

the sort sorts on the original sequence number


bbbbbb...1...1
bbbbbb...2...2
aaaaaa...3...1
aaaaaa...4...2
bbbbbb...5...3
bbbbbb...6...4

the outrec keeps only the records with a 1 in the record in the block
bbbbbb...1...1
aaaaaa...3...1
and drops all the auxiliary fields
bbbbbb...
aaaaaa...
Back to top
View user's profile Send private message
mksranjani

New User


Joined: 03 Feb 2010
Posts: 29
Location: Chennai

PostPosted: Mon Jun 13, 2011 3:23 pm
Reply with quote

thank u enrico... it was helpful...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM Goto page Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top