Help needed in SYNCTOOL



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Help needed in SYNCTOOL

Postby SANDHYA BUDHI » Mon Jul 21, 2008 8:00 pm

I have 2 input files . The LRECL of file A is 10 charaters and file B is 503. I have to take a ID from the file A and check if it is in File B. If exists then move the id in the File A to the output file.

But the ID in file A is in the position 1 and in the File B it is in the position 40. will I be able to do a compare and get the dupliacte ID in the output file.

can I do this using SYNCTOOL or any other way is possible.. In SYNCTOOL which I referred the ID's are in the same position in both the files.

Please help how to proceed with this
SANDHYA BUDHI
 
Posts: 19
Joined: Mon Jul 21, 2008 7:52 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Help needed in SYNCTOOL

 

Re: Help needed in SYNCTOOL

Postby Alissa Margulies » Mon Jul 21, 2008 9:02 pm

This can be accomplished using SyncSort's JOIN feature, which is available in SyncSort for z/OS 1.2 and 1.3.

Assuming the ID is 10 bytes, try this:
//STEP1  EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTOUT  DD DSN=OUTPUT.FILE
//SORTJNF1 DD DSN=FILEA    (LRECL=10)
//SORTJNF2 DD DSN=FILEB    (LRECL=503)
//SYSIN    DD *
   JOINKEYS FILE=F1,FIELDS=(1,10,A)
   JOINKEYS FILE=F2,FIELDS=(40,10,A)
   REFORMAT FIELDS=(F1:1,10)
   SORT FIELDS=COPY
/*
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: Help needed in SYNCTOOL

Postby SANDHYA BUDHI » Wed Jul 23, 2008 2:53 pm

Hi,

Thanks for your timely help.

I tried using the SYNCTOOL with the files having the same LRECL. Please find my JCL

//SYNC01 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//FILEIN DD DSN=FILE1,
// DISP=SHR
// DD DSN=FILE2,
// DISP=SHR
//NODUPS DD DSN=OUTFILE,
// DISP=(,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=500,BLKSIZE=0),
// UNIT=SMS,SPACE=(CYL,(90,90),RLSE)
//TOOLIN DD *
SELECT FROM(FILEIN) TO(NODUPS) ON(01,07,CH) ALLDUPS
/*

Suppose my file1 contains

AA
BB
CC

File 2

BB
CC

The output file should have only

BB
CC

But using the above SORT I am getting the output file as

BB
BB
CC
CC

I can use one more sort for getting rid of these duplicates. Will I be able to do it using SUNCTOOL itself.
SANDHYA BUDHI
 
Posts: 19
Joined: Mon Jul 21, 2008 7:52 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Help needed in SYNCTOOL

Postby Alissa Margulies » Fri Jul 25, 2008 12:56 am

Sandhya -- Based on your example, this can be accomplished in a single step. Try this:
//STEP1  EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTOUT  DD DSN=OUTPUT.FILE
//SORTJNF1 DD *
AA
BB
CC
//SORTJNF2 DD *
BB
CC
//SYSIN    DD *
   JOINKEYS FILE=F1,FIELDS=(1,2,A)
   JOINKEYS FILE=F2,FIELDS=(1,2,A)
   REFORMAT FIELDS=(F1:1,2)
   SORT FIELDS=COPY
/*
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: Help needed in SYNCTOOL

Postby ranga_subham » Tue Jul 29, 2008 9:31 pm

Alissa,

Where the non-matching records will be written? I want to capture those too.........

Pls suggest.

Thanks.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Help needed in SYNCTOOL

Postby Alissa Margulies » Thu Jul 31, 2008 2:05 am

That is a different requirement than the original post. This JCL will provide you with the desired results.
//SORT1 EXEC PGM=SORT
//SORTJNF1 DD *                       
AA                                   
BB                                   
CC                                   
//SORTJNF2 DD *                       
BB                                   
CC                                   
//SORTOF01 DD DSN=MATCHED.RECORDS
//SORTOF02 DD DSN=UNMATCH.RECORDS
//SYSOUT DD SYSOUT=*                 
//SYSIN    DD *                       
   JOINKEYS FILE=F1,FIELDS=(1,2,A)               
   JOINKEYS FILE=F2,FIELDS=(1,2,A)               
   REFORMAT FIELDS=(F1:1,2,F2:1,2)
   JOIN UNPAIRED                                 
   SORT FIELDS=COPY                               
   OUTFIL FILES=01,                               
     INCLUDE=(3,2,CH,NE,C' '),                   
       OUTREC=(1,2)                               
   OUTFIL FILES=02,                               
     INCLUDE=(3,2,CH,EQ,C' '),                   
       OUTREC=(1,2)                               
/*     
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: Help needed in SYNCTOOL

Postby ranga_subham » Thu Jul 31, 2008 7:31 pm

Alissa,

I tried the sort given by you and it gives me following output:

SORTOF01:
AA
BB

SORTOF02:
AA
BB

SORTOUT:
AAAA
BBBB
CC


And, I expected the output like the below:

SORTOF01: Matched records from the two files
AA
BB

SORTOF02: Non-Matched records from the 1st file
AA
BB

SORTOUT: Non-Matching records from the 2nd file
CC


Please suggest.

Thanks.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Help needed in SYNCTOOL

Postby Alissa Margulies » Thu Jul 31, 2008 8:10 pm

Show me your exact control cards. Something about your OUTFIL coding is not what I specified. Furthermore, if you want unmatched records from File2 written to SORTOUT, then you need to add the following:
OUTFIL FILES=OUT,
   INCLUDE=(1,2,CH,EQ,C' '),                   
     OUTREC=(3,2)

Or you can change the SORTOUT DD to SORTOF03, and change the above
OUTFIL FILES=OUT
   
    to

OUTFIL FILES=03
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post