Page 1 of 2

some help in synctool

PostPosted: Wed Feb 27, 2008 11:57 am
by fazillatheef
Hi
I would like to have some help to do the particular problem using synctool.

I have two input PS
TRGE09.FIRST and TRGE09.SECOND (the record length is 10)
each PS contains a record and it contains a numerical value

and two output PS
TGRE09.OUT1 and TRGE09.OUT2 (the record length is 10)

I need to compare the fields from TRGE09.FIRST and TRGE09.SECOND
and if the first one is lesser than or equal to the second one
the first one is put into TGRE09.OUT1
or if the first one is greater than the second one
the second one is put into TRGE09.OUT2

Re: some help in synctool

PostPosted: Wed Feb 27, 2008 9:10 pm
by CICS Guy
Huh?

Maybe some samples of the input and expected output might be helpful......

Re: some help in synctool

PostPosted: Thu Feb 28, 2008 2:18 am
by Alissa Margulies
Let me see if I understand your requirements. Basically, you want to keep only the smaller values. If the smaller value comes from the 1st file, put it in OUTFIL1, doing nothing with the record from File2. However, if the smaller value is in File2, then write the record from File2 to OUTPUT2 and do nothing with the record from File1. Am I correct so far?

And is there a key field in each file that will correspond the records from File1 to File2?

Re: some help in synctool

PostPosted: Thu Feb 28, 2008 8:27 am
by fazillatheef
yes ,what you have said is correct. But there is no key field for each record

Re: some help in synctool

PostPosted: Thu Feb 28, 2008 3:48 pm
by arunprasad.k
I have two input PS TRGE09.FIRST and TRGE09.SECOND (the record length is 10) each PS contains a record and it contains a numerical value


Does it mean each PS files has only one record?

Arun.

Re: some help in synctool

PostPosted: Thu Feb 28, 2008 4:39 pm
by fazillatheef
yes

Re: some help in synctool

PostPosted: Thu Feb 28, 2008 9:26 pm
by William Thompson
As was said earlier:
CICS Guy wrote:Maybe some samples of the input and expected output might be helpful......

Re: some help in synctool

PostPosted: Fri Feb 29, 2008 2:00 am
by Alissa Margulies
fazillatheef wrote:I would like to have some help to do the particular problem using synctool.
Any reason for wanting to specifically use SYNCTOOL for this application instead of SyncSort?

Re: some help in synctool

PostPosted: Fri Feb 29, 2008 2:49 am
by Alissa Margulies
Here is 1 possible SYNCTOOL solution:
//S1    EXEC  PGM=SYNCTOOL   
//TOOLMSG DD SYSOUT=*       
//DFSMSG  DD SYSOUT=*       
//IN1 DD DSN=TRGE09.FIRST
//IN2 DD DSN=TRGE09.SECOND               
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT1 DD DSN=TGRE09.OUT1
//OUT2 DD DSN=TGRE09.OUT2
//TOOLIN DD *                                                 
COPY FROM(IN1) TO(T1) USING(CTL1)                             
COPY FROM(IN2) TO(T1) USING(CTL2)                             
SPLICE FROM(T1) TO(OUT1) ON(21,8,ZD) WITH(11,10) USING(CTL3)   
SPLICE FROM(T1) TO(OUT2) ON(21,8,ZD) WITH(11,10) USING(CTL4)   
/*                                                           
//CTL1CNTL DD *                                               
  INREC BUILD=(1,10,21:SEQNUM,8,ZD)                           
/*                                                           
//CTL2CNTL DD *                                               
  INREC BUILD=(11:1,10,21:SEQNUM,8,ZD)                         
/*                                                           
//CTL3CNTL DD *                                               
  OUTFIL FNAMES=OUT1,INCLUDE=(1,10,ZD,LE,11,10,ZD),OUTREC=(1,10) 
/*                                                           
//CTL4CNTL DD *                                               
  OUTFIL FNAMES=OUT2,INCLUDE=(11,10,ZD,LT,1,10,ZD),OUTREC=(11,10) 
/*

However, I think that a SyncSort JOIN application may also suit your needs. Let me kow if you are interested.

Re: some help in synctool

PostPosted: Fri Feb 29, 2008 10:55 am
by fazillatheef
Thank you