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

SYNCSORT Extending the problem statement


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Mon Apr 28, 2008 10:35 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
No new posts z/vm installation problem All Other Mainframe Topics 0
No new posts Job scheduling problem. JCL & VSAM 9
Search our Forums:

Back to Top