Page 1 of 1

Synctool or SPLICE solution possible !?

PostPosted: Wed Sep 30, 2009 9:36 pm
by ranga_subham
Hi,

I have two input files to be compared (RECFM=FB, LRECL=80) and need to write matched records from FILE-2 to output.

File-1: Key field 1 to 6
----+----1----+----2----+----3----+----4----+
XMTR51 TG1SE51XXAS106591 NOT A VALID ORDER
YMVSF2 TG1SE51XXAS110365 NOT A VALID ORDER
ZPBDN3 TG1SE51XXAS110379 NOT A VALID ORDER


File-2: Key field 21 to 26
----+----1----+----2----+----3----+----4----+
1TZA9         232   XMTR51
0SVJ9         232   YMVSZ2
0SVJ9         232   ZPBDN3


Required Output:
1TZA9         232   XMTR51
0SVJ9         232   ZPBDN3


I have achieved it using JOINKEYS feature of Syncsort. Is it possible to achieve it using SPLICE or SELECT (Synctool) features too?

Thanks.

Re: Synctool or SPLICE solution possible !?

PostPosted: Thu Oct 01, 2009 4:52 am
by Thampy
Please try the following Jcl. I am assuming your both the input files record length are 80.

//STEP005 EXEC PGM=SYNCTOOL
//FILE1 DD *
XMTR51 TG1SE51XXAS106591 NOT A VALID ORDER
YMVSF2 TG1SE51XXAS110365 NOT A VALID ORDER
ZPBDN3 TG1SE51XXAS110379 NOT A VALID ORDER
//*
//FILE2 DD *
1TZA9 232 XMTR51
0SVJ9 232 YMVSZ2
0SVJ9 232 ZPBDN3
//*
//T1 DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(TRK,(10,10),RLSE)
//OUTPUT DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//SSMSG DD SYSOUT=*
//TOOLIN DD *
COPY FROM(FILE1) TO(T1) USING(CTL1)
COPY FROM(FILE2) TO(T1)
SPLICE FROM(T1) TO(OUTPUT) ON(21,6,CH) WITH(1,20) WITH(27,53)
//CTL1CNTL DD *
INREC BUILD=(20X,1,6,53X)
//*

Re: Synctool or SPLICE solution possible !?

PostPosted: Thu Oct 01, 2009 9:29 pm
by ranga_subham
Thampy, I've tried your solution and got below result.....

0SVJ9 232 ZPBDN3


Thanks :?

Re: Synctool or SPLICE solution possible !?

PostPosted: Fri Oct 02, 2009 12:58 am
by Thampy
Ranga, I ran the jcl which I posted in the forum and I am getting two rows as you expected.
1TZA9 232 XMTR51
0SVJ9 232 ZPBDN3

Re: Synctool or SPLICE solution possible !?

PostPosted: Wed Oct 07, 2009 10:33 pm
by ranga_subham
Thampy, I have tried your code with Syncsort v1.2.3 and Syncsort v1.3.2 and it gives me only one record in output :?

I have achieved it with this workaround:
//STEP0001 EXEC PGM=SYNCTOOL                 
//            DISP=SHR                       
//FILE1    DD *                               
XMTR51 TG1SE51XXAS106591 NOT A VALID ORDER   
YMVSF2 TG1SE51XXAS110365 NOT A VALID ORDER   
ZPBDN3 TG1SE51XXAS110379 NOT A VALID ORDER   
//*                                           
//FILE2    DD *                               
1TZA9 232 XMTR51                             
0SVJ9 232 YMVSZ2                             
0SVJ9 232 ZPBDN3                             
//*                                           
//T1       DD DSN=&&T1,                       
//            DISP=(MOD,PASS),               
//            SPACE=(CYL,(1,1),RLSE)         
//OUTPUT   DD SYSOUT=*                       
//TOOLMSG  DD SYSOUT=*                       
//SSMSG DD SYSOUT=*                           
//TOOLIN   DD *                                 
  COPY FROM(FILE1) TO(T1) USING(CTL1)           
  COPY FROM(FILE2) TO(T1)                       
  SELECT FROM(T1) TO(OUTPUT) ON(11,6,CH) LASTDUP
//CTL1CNTL DD *                                 
  INREC BUILD=(11:1,80)                         
//*                                             


Thanks.