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

SYNCSORT/SYNCTOOL : Is there a better way


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

Active User


Joined: 14 Jun 2005
Posts: 186
Location: USA

PostPosted: Thu May 14, 2009 1:21 am
Reply with quote

Here is a job which when account #'s in both files are matching, compares rest of the data and if different write out difference or matching data.

And this job uses two steps:

Code:

//STEP1  EXEC  PGM=SYNCSORT                                             
//SYSOUT    DD  SYSOUT=*                                             
//SORTJNF1  DD *                                                     
ACCT1  AAA                                                           
ACCT2  BBB                                                           
ACCT3  CCC                                                           
ACCT4  DDD                                                           
ACCT5  EEE                                                           
/*                                                                   
//SORTJNF2  DD *                                                     
ACCT1  AA1                                                           
ACCT2  BB1                                                           
ACCT3  CC1                                                           
ACCT4  DDD                                                           
/*                                                                   
//SORTOUT   DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)   
//SYSIN    DD    *                                                   
  JOINKEYS FILE=F1,FIELDS=(1,5,A)                                   
  JOINKEYS FILE=F2,FIELDS=(1,5,A)                                   
  REFORMAT FIELDS=(F1:01,10,F2:6,5)                                 
  SORT FIELDS=COPY                                                   
/*                                                                   
//STEP2  EXEC  PGM=SYNCTOOL     
//TOOLMSG   DD  SYSOUT=*                               
//DFSMSG    DD  SYSOUT=*                               
//IN        DD DSN=&&T1,DISP=(OLD,PASS)               
//OUT1 DD SYSOUT=*                                     
//OUT2 DD SYSOUT=*                                     
//TOOLIN DD *                                         
COPY FROM(IN) USING(CTL1)                             
/*                                                     
//CTL1CNTL DD *                                       
  OUTFIL FNAMES=OUT1,INCLUDE=(6,5,CH,EQ,11,5,CH)       
  OUTFIL FNAMES=OUT2,SAVE                             
/*                                                     
                                     


And I get expected results:

OUT2:

Code:

ACCT1  AAA  AA1   
ACCT2  BBB  BB1   
ACCT3  CCC  CC1   


OUT1:
Code:

ACCT4  DDD  DDD


Can this be accomplished in one step?
Back to top
View user's profile Send private message
santosh.ambaprasad

New User


Joined: 08 Mar 2009
Posts: 16
Location: London

PostPosted: Thu May 14, 2009 3:34 am
Reply with quote

Hi

Try using SYNCTOOL........ let me know if you see any unexpected result.. icon_smile.gif
Code:

//STEP1 EXEC PGM=SYNCTOOL
//SYSOUT DD SYSOUT=*
//JNF1  DD *                                                     
ACCT1AAA                                                           
ACCT2BBB                                                           
ACCT3CCC                                                           
ACCT4DDD                                                           
ACCT5EEE                                                           
/*                                                                   
//JNF2  DD *                                                     
ACCT1AA1                                                           
ACCT2BB1                                                           
ACCT3CC1                                                           
ACCT4DDD                                                           
/*                                                                   
//TEMP DD DSN=&&TEMP,DISP=MOD
//OUT1 DD *
//OUT2 DD *
//TOOLIN DD *
  COPY FROM(JNF1) TO(TEMP) USING CNTL1
  COPY FROM(JNF2) TO(TEMP) USING CNTL2
  SPLICE FROM(TEMP) TO(OUT2) ON(3,8,CH) WITH(12,1) USING CNTL3
  SPLICE FROM(TEMP) TO(OUT1) ON(3,5,CH) WITH(02,1) USING CNTL4
//CNTL1CNTL DD *
  OUTREC=(C'11',1,8,C'11')
//CNTL2CNTL DD *
  OUTREC=(C'22',1,8,C'22')
//CNTL3CNTL DD *
  OUTFIL FNAMES=OUT2,INCLUDE=(11,2,CH,EQ,C'12')
//CNTL4CNTL DD *
  OUTFIL FNAMES=OUT1,INCLUDE=(1,2,CH,EQ,C'12')
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu May 14, 2009 9:04 am
Reply with quote

MFRASHEED,

You can include those OUTFIL statements in your initial JOIN itself like this in order to accomplish this. And do remember to add OUT1 and OUT2 ddnames instead of SORTOUT.
Code:
//SYSIN     DD *                               
  JOINKEYS FILE=F1,FIELDS=(1,5,A)               
  JOINKEYS FILE=F2,FIELDS=(1,5,A)               
  REFORMAT FIELDS=(F1:01,10,F2:6,5)             
  SORT FIELDS=COPY                             
  OUTFIL FNAMES=OUT1,INCLUDE=(6,5,CH,EQ,11,5,CH)
  OUTFIL FNAMES=OUT2,SAVE 
Back to top
View user's profile Send private message
MFRASHEED

Active User


Joined: 14 Jun 2005
Posts: 186
Location: USA

PostPosted: Fri May 15, 2009 12:09 am
Reply with quote

Thanks to both of you, solution works.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri May 15, 2009 12:37 am
Reply with quote

You're welcome. Since you have SyncSort JOIN, I would recommend a simple Syncsort JOIN solution rather than a Synctool SPLICE job which would involve additional data passes.
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 Synctool-dynamic split job for varyin... JCL & VSAM 7
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts Syncsort "Y2C" Function SYNCSORT 1
Search our Forums:

Back to Top