Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SYNCSORT Extending the problem statement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
gaurao

New User


Joined: 27 Mar 2006
Posts: 6

PostPosted: Mon Apr 28, 2008 5:38 pm    Post subject: SYNCSORT Extending the problem statement
Reply with quote

Hi Experts..

This is a very common problem.
But at time we also need to retain a Duplicate record
along with Inserted,Deleted or Updated ones.

So how can we retain, say 1st occurence of the duplicated records.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Apr 28, 2008 10:35 pm    Post subject:
Reply with quote

Hello,

Please post some sample data from both input files and the output you want when these are processed.

Also, post the "rules" for processing as well as the attributes for the files.
Back to top
View user's profile Send private message
gaurao

New User


Joined: 27 Mar 2006
Posts: 6

PostPosted: Tue Apr 29, 2008 5:57 pm    Post subject:
Reply with quote

See below:

//IN1 DD *
GAURAO 00001
RAMESH 00002
AWARE 99999
/*
//IN2 DD *
GAURAO 68314
RAMESH 00002
VISHAL 22544
/*
//OLD DD SYSOUT=*
//NEW DD SYSOUT=*
//T1 DD DSN=&&T1,SPACE=(TRK,(1,1),RLSE),DISP=(MOD,PASS)
//T2 DD DSN=&&T2,SPACE=(TRK,(1,1),RLSE),DISP=(NEW,DELETE)
//TEMP DD DSN=&&TEMP,SPACE=(TRK,(1,1),RLSE),DISP=(NEW,DELETE)
//IAD DD DSN=&&IAD,SPACE=(TRK,(1,1),RLSE),DISP=(NEW,PASS)
//UPD DD DSN=&&UPD,SPACE=(TRK,(1,1),RLSE),DISP=(NEW,PASS)
//ORG DD DSN=&&ORG,SPACE=(TRK,(1,1),RLSE),DISP=(NEW,PASS)
//CON DD DSN=*.IAD,VOL=REF=*.IAD,DISP=(OLD,DELETE)
// DD DSN=*.UPD,VOL=REF=*.UPD,DISP=(OLD,DELETE)
// DD DSN=*.ORG,VOL=REF=*.ORG,DISP=(OLD,DELETE)
//OUT DD SYSOUT=*
//ORG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(T2) ON(1,12,CH) NODUPS DISCARD(TEMP)
SELECT FROM(TEMP) TO(ORG) ON(1,12,CH) FIRSTDUP USING(CTL5)
SELECT FROM(T2) TO(IAD) ON(1,6,CH) NODUPS DISCARD(UPD) USING(CTL3)
SORT FROM(CON) TO(OUT) USING(CTL4)
//CTL1CNTL DD *
INREC BUILD=(1,12,C'DOLD')
//CTL2CNTL DD *
INREC BUILD=(1,12,C'INEW')
//CTL3CNTL DD *
OUTFIL FNAMES=IAD
OUTFIL FNAMES=UPD,OVERLAY=(13:C'U')
//CTL4CNTL DD *
SORT FIELDS=(1,6,CH,A,12,4,CH,A)
//CTL5CNTL DD *
OUTFIL FNAMES=ORG,OVERLAY=(13:C'ORGL')
/*
Output I got:

AWARE 99999DOLD
GAURAO 00001UOLD
GAURAO 68314UNEW
RAMESH 00002ORGL
VISHAL 22544INEW

I got RAMESH record (first occurence of duplicate)in the above way.
Is there any better method?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us