moving of matched and unmatched records



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

moving of matched and unmatched records

Postby shyamsaravan » Fri Sep 03, 2010 6:45 pm

Hi;
I used the synsort to write a matched and unmatched records to two different files.
JCL is
//STEP0100 EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//INA      DD *                                               
F2010-06-16125ESB46066361                                     
F2010-06-16125ESB77777777                                     
F2010-06-16125ESB12345678                                     
F2010-06-16125ESB23456789                                     
F2010-06-16125ESB98765432                                     
//INB      DD *                                               
F2010-06-16125ESB46066361                                     
F2010-06-16125ESB98765432                                     
F2010-06-16125ESB55555555                                     
F2010-06-16125ESB23456789                                     
F2010-06-16125ESB66666666                                     
F2010-06-16125ESB12345678                                     
//MATCH    DD SYSOUT=*                                       
//UNMATCH  DD SYSOUT=*                                       
//SYSIN    DD *                                               
  OPTION COPY                                                 
  JOINKEYS F1=INA,FIELDS=(1,25,A)                             
  JOINKEYS F2=INB,FIELDS=(1,25,A)                             
  JOIN UNPAIRED                                               
  REFORMAT FIELDS=(?,F1:1,80,F2:1,80)                         
  OUTFIL FNAMES=MATCH,INCLUDE=(1,1,CH,EQ,C'B'),BUILD=(1,80)   
  OUTFIL FNAMES=UNMATCH,SAVE,                                 
  IFTHEN=(WHEN=(1,1,ZD,EQ,1),BUILD=(02,80)),                 
  IFTHEN=(WHEN=(1,1,ZD,EQ,2),BUILD=(82,80))                   
//*


when i am doing 'JJ'
E1  8 DSS20011E  DD 'SORTIN' WAS NOT ALLOCATED.         
E2  8 DSS11051E  UNRECOGNIZED 'SORT' KEYWORD 'JOINKEYS'.
E3  8 DSS11051E  UNRECOGNIZED 'SORT' KEYWORD 'JOINKEYS'.
E4  8 DSS11051E  UNRECOGNIZED 'SORT' KEYWORD 'JOIN'.     
E5  8 DSS11051E  UNRECOGNIZED 'SORT' KEYWORD 'REFORMAT'.

When i ran the jcl,abended and below message got at SYSOUT.What it does mean?
1 SYNCSORT FOR Z/OS  1.3.2.1R    U.S. PATENTS: 4210961, 5117495
                                      ABCCOMPANY
  SYNCSORT LICENSED FOR CPU SERIAL NUMBER A0E5F, MODEL 2094 507
  SYSIN :                                                       
    OPTION COPY                                                 
    JOINKEYS F1=INA,FIELDS=(1,25,A)                             
             *                                                 
    JOINKEYS F2=INB,FIELDS=(1,25,A)                             
             *                                                 
    JOIN UNPAIRED                                               
    REFORMAT FIELDS=(?,F1:1,80,F2:1,80)                         
             *                                                 
    OUTFIL FNAMES=MATCH,INCLUDE=(1,1,CH,EQ,C'B'),BUILD=(1,80)   
    OUTFIL FNAMES=UNMATCH,SAVE,                                 
    IFTHEN=(WHEN=(1,1,ZD,EQ,1),BUILD=(02,80)),                 
      IFTHEN=(WHEN=(1,1,ZD,EQ,2),BUILD=(82,80))                 
  WER268A  JOINKEYS STATEMENT: SYNTAX ERROR                     
  WER268A  JOINKEYS STATEMENT: SYNTAX ERROR                     
  WER268A  REFORMAT STATEMENT: SYNTAX ERROR     
shyamsaravan
 
Posts: 40
Joined: Tue May 11, 2010 7:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: moving of matched and unmatched records

Postby Alissa Margulies » Fri Sep 03, 2010 8:24 pm

That is not the correct syntax for SyncSort. The following should give you the desired output:
//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*   
//SORTJNF1 DD *         
F2010-06-16125ESB46066361
F2010-06-16125ESB77777777
F2010-06-16125ESB12345678
F2010-06-16125ESB23456789
F2010-06-16125ESB98765432
//SORTJNF2 DD *         
F2010-06-16125ESB46066361
F2010-06-16125ESB98765432
F2010-06-16125ESB55555555
F2010-06-16125ESB23456789
F2010-06-16125ESB66666666
F2010-06-16125ESB12345678
//MATCH    DD SYSOUT=*   
//UNMATCH  DD SYSOUT=*         
//SYSIN    DD *                                               
  JOINKEYS FILES=F1,FIELDS=(1,25,A)                           
  JOINKEYS FILES=F2,FIELDS=(1,25,A)                           
  JOIN UNPAIRED                                               
  REFORMAT FIELDS=(F1:1,80,F2:1,80)                           
  SORT FIELDS=COPY                                           
  OUTFIL FNAMES=MATCH,                                       
     INCLUDE=(1,1,CH,NE,C' ',AND,81,1,CH,NE,C' '),BUILD=(1,80)
  OUTFIL FNAMES=UNMATCH,                                     
    IFTHEN=(WHEN=(1,1,CH,NE,C' '),BUILD=(01,80)),             
    IFTHEN=(WHEN=(1,1,CH,EQ,C' '),BUILD=(81,80))             
/*
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: 3 times

Re: moving of matched and unmatched records

Postby shyamsaravan » Mon Sep 06, 2010 3:45 pm

Hi;
Thanks Alissa,I ran the JCL,below is the output
Matched records output
F2010-06-16125ESB12345678
F2010-06-16125ESB23456789
F2010-06-16125ESB46066361
F2010-06-16125ESB98765432

Unmatched records output
F2010-06-16125ESB12345678
F2010-06-16125ESB23456789
F2010-06-16125ESB46066361
F2010-06-16125ESB55555555
F2010-06-16125ESB66666666
F2010-06-16125ESB77777777
F2010-06-16125ESB98765432

I got unmatched records ouput has repeated matched records also
My unmatched records output should like
F2010-06-16125ESB55555555
F2010-06-16125ESB66666666
F2010-06-16125ESB77777777

OUTFIL FNAMES=UNMATCH,
IFTHEN=(WHEN=(1,1,CH,NE,C' '),BUILD=(01,80)),
IFTHEN=(WHEN=(1,1,CH,EQ,C' '),BUILD=(81,80))

Im trying to write the unmatched records to noe file,but it asks LRECL=160,BLKSIZE=5320 format.
I need to write both match and unmatch records to two different LRECL=80 bytes files
Please Help;
shyamsaravan
 
Posts: 40
Joined: Tue May 11, 2010 7:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: moving of matched and unmatched records

Postby Thampy » Tue Sep 07, 2010 1:25 am

Change the second Outfil statement as below.

OUTFIL FNAMES=UNMATCH,SAVE,
IFTHEN=(WHEN=(1,1,CH,NE,C' '),BUILD=(01,80)),
IFTHEN=(WHEN=(1,1,CH,EQ,C' '),BUILD=(81,80))
Thampy
 
Posts: 36
Joined: Sat Sep 26, 2009 2:27 pm
Has thanked: 0 time
Been thanked: 3 times

Re: moving of matched and unmatched records

Postby shyamsaravan » Tue Sep 07, 2010 12:36 pm

Hi;
Thanks Thampy,the only unmatched records moved to UNMATCH file
Im trying to write the unmatched records to noe file,but it asks LRECL=160,BLKSIZE=5320 format.
I need to write both match and unmatch records to two different LRECL=80 bytes files


My question is,why the unmatched records file has LRECL=160 bytes instead of 80bytes ?
I tried to write unmatch records at 80 bytes file,but it is abended,,I want to do at 80bytes file
shyamsaravan
 
Posts: 40
Joined: Tue May 11, 2010 7:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: moving of matched and unmatched records

Postby Alissa Margulies » Tue Sep 07, 2010 8:00 pm

shyamsaravan wrote:I got unmatched records ouput has repeated matched records also

Thampy wrote:Change the second Outfil statement as below.

OUTFIL FNAMES=UNMATCH,SAVE,
IFTHEN=(WHEN=(1,1,CH,NE,C' '),BUILD=(01,80)),
IFTHEN=(WHEN=(1,1,CH,EQ,C' '),BUILD=(81,80))

Yes, that is correct. Simple mistake of cut/paste. Thank you for pointing that out and making the correction.
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: 3 times

Re: moving of matched and unmatched records

Postby Alissa Margulies » Tue Sep 07, 2010 8:21 pm

shyamsaravan wrote:Im trying to write the unmatched records to noe file,but it asks LRECL=160,BLKSIZE=5320 format.
I need to write both match and unmatch records to two different LRECL=80 bytes files

The following code will produce an 80-byte LRECL for the unmatched records:
OUTFIL FNAMES=UNMATCH,SAVE,                     
  IFTHEN=(WHEN=(1,1,CH,NE,C' '),BUILD=(01,80)),
  IFTHEN=(WHEN=NONE,BUILD=(81,80))             
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: 3 times

Re: moving of matched and unmatched records

Postby shyamsaravan » Wed Sep 08, 2010 1:21 pm

Thanks Alissa;

It is working fine :D
shyamsaravan
 
Posts: 40
Joined: Tue May 11, 2010 7:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: moving of matched and unmatched records

Postby BGronli » Tue Sep 11, 2012 7:17 pm

Looks like I am barking up the wrong tree, we have DFSORT, so I need to figure it out for that toolset. Thanks.

I am looking to join 2 files, both have lrecl of 455, keys are 1,32,CH,A,81,39,CH,A. I am looking to retain all unmatched records from both files plus matched records from file 1. The code shown in this post looks like it will probably do the trick, but there are a couple of things I am unsure of, such as:

INCLUDE=(1,1,CH,NE,C' ',AND,81,1,CH,NE,C' '),BUILD=(1,80)
What does the 81 represent here? and why the check to see if the first position is not a space?

IFTHEN=(WHEN=NONE,BUILD=(81,80))
Again, why 81 here?

Thank you.
Last edited by BGronli on Tue Sep 11, 2012 7:23 pm, edited 1 time in total.
BGronli
 
Posts: 5
Joined: Tue Sep 11, 2012 6:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: moving of matched and unmatched records

Postby NicC » Tue Sep 11, 2012 7:22 pm

beacause, I believe, JOINKEYS physically joins the 2 records internally. The first record is bytes 1-80 and the second byte 81-160.

Now, I got that info from reading the forums every day - do likewise and you will learn a lot more - possibly more than you will need but you never know when a new job opportunity might require some knowledge that you would not otherwise have.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Next

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post