matched and unmatched records in diff outfile



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

matched and unmatched records in diff outfile

Postby shyamsaravan » Thu Sep 02, 2010 2:47 pm

Hi;
How to write a matched records and unmatched records in a different file in SORT.
Both input files to be compared with each record and the matched records needs to be writtten in one out file,and remaining un matched records to aonther file
Input and output of two files are FB,LRECL 80
File A has
F2010-06-16125ESB46066361
F2010-06-16125ESB77777777
F2010-06-16125ESB12345678
F2010-06-16125ESB23456789
F2010-06-16125ESB98765432

File B has
F2010-06-16125ESB46066361
F2010-06-16125ESB98765432
F2010-06-16125ESB55555555
F2010-06-16125ESB23456789
F2010-06-16125ESB66666666
F2010-06-16125ESB12345678

Output should be
matched records outfile
F2010-06-16125ESB46066361
F2010-06-16125ESB12345678
F2010-06-16125ESB23456789
F2010-06-16125ESB98765432

un matched records outfile
F2010-06-16125ESB77777777
F2010-06-16125ESB55555555
F2010-06-16125ESB66666666


Please help!
shyamsaravan
 
Posts: 40
Joined: Tue May 11, 2010 7:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: matched and unmatched records in diff outfile

 

Re: matched and unmatched records in diff outfile

Postby skolusu » Thu Sep 02, 2010 10:08 pm

shyamsaravan,

You need to take some time and explain the rules of matching. What is the KEY to match ? complete 80 bytes or just 25 bytes? Does any file have duplicates?

Assuming your matching key is the first 25 bytes and have duplicates on the key, here is a DFSORT job which will give you the desired results.

//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))                   
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: matched and unmatched records in diff outfile

Postby shyamsaravan » Fri Sep 03, 2010 5:37 pm

Hi;
Thank you,Sorry for the given short of info.The key is a complete 80 bytes, and it have duplicates also.So matched records need to move one outfile and remainig unmatched records from both input file need to move one another outfile.

When i am doing 'JJ' ,got the below messages
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'.


Eventhough,When i ran the code and abendesand got the below message displayed in Sysout
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                     


I used the same code in my JCL what you suggested.
shyamsaravan
 
Posts: 40
Joined: Tue May 11, 2010 7:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: matched and unmatched records in diff outfile

Postby NicC » Fri Sep 03, 2010 6:16 pm

You are using SYNCSORT not DFSORT. Frank and Kolusu will not be able to answer your question as they are DFSORT developers and SYNCSORT is a rival product. You should check the SYNCSORT manual to see if a) JOINKEYS is supposrted for the version you have and if it is, b) check the syntax. For some things there is a difference in syntax between DFSORT and SYNCSORT and what Kolusu gave you was the DFSORT syntax.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: matched and unmatched records in diff outfile

Postby dick scherrer » Sat Sep 04, 2010 1:18 am

Hello,

The version of Syncsort you have supports JOINing.

Try without the OPTION COPY. . .

Sugggest you refer to the examples in the documentation.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: matched and unmatched records in diff outfile

Postby Alissa Margulies » Sat Sep 04, 2010 1:28 am

This is a duplicate post. I am locking this thread. Please see syncsort-synctool/topic4173.html
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