MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

can i get unmatches record when using splice

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
sharada
Beginner


Joined: 24 Aug 2005
Posts: 32
Topics: 14
Location: Hyderabad

PostPosted: Thu Aug 25, 2005 3:30 am    Post subject: can i get unmatches record when using splice Reply with quote

I have used SPLICE option with SYNCTOOL, to match two files on a common field and write those records which are matched into an output file.

I want to write the records which are not matched into another output file, is there any provision to get the unmatched records.

Following are the details.

First input file IN1

100006XXXUS
300006YYYUK
200006ZZZGR

Second input file IN2

ABCD200006EU
APFGH400006AS


This is the way that I used the SYNCTOOL

//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T2) USING(CTL2)
SELECT FROM(CON) TO(OUT) ON(1,6,CH) ALLDUPS
SPLICE FROM(OUT) TO(OUT1) ON(1,6,CH) WITH(8,2)
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1:1,6,CH,7:10,2)
/*
//CTL2CNTL DD *
OUTREC FIELDS=(1:5,6,CH,7:X,8:11,2)
/*

NOTE: CON is the concatenated file of T1 and T2.

After execution

T1 looks like this

100006US
300006UK
200006GR

T2 looks like this

200006 EU
400006 AS

CON looks like this

100006US
300006UK
200006GR
200006 EU
400006 AS

OUT looks like this

200006GREU

UP TO NOW ITS OK,
WHAT I NEED NOW IS TO GET THE RECORDS FROM BOTH THE FILES I1 AND I2 IN A SEPARATE OUTPUT FILE, WHICH SHOULD LOOK LIKE

100006
300006
400006

CAN ANYBODY SUGGEST ME HOW TO DO IT.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Aug 25, 2005 6:24 am    Post subject: Reply with quote

Sharada,

Try this JCL.

Code:

//********************************************************************
//* THIS STEP WRITES 3 FILES.                                        *
//* A MATCH FILE(MATCH) WHERE RECORDS FROM FILE1 AND FILE2 ARE MATCH *
//* AN OUTPUT FILE(ONLYF1) WHEN THE KEY IS FOUND ONLY ON FILE1       *
//* AN OUTPUT FILE(ONLYF2) WHEN THE KEY IS FOUND ONLY ON FILE2       *
//********************************************************************
//STEP0100 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTJNF1 DD *                                                       
100006US                                                             
300006UK                                                             
200006GR                                                             
//SORTJNF2 DD *                                                       
200006 EU                                                             
400006 AS                                                             
//MATCH    DD SYSOUT=*                                               
//ONLYF1   DD SYSOUT=*                                               
//ONLYF2   DD SYSOUT=*                                               
//SYSIN    DD *                                                       
  JOINKEYS FILES=F1,FIELDS=(01,6,A)                                   
  JOINKEYS FILES=F2,FIELDS=(01,6,A)                                   
  REFORMAT FIELDS=(F1:1,08,                                           
                   F2:1,09),FILL=X'FF'                               
  SORT FIELDS=(1,6,CH,A)                                             
  JOIN UNPAIRED                                                       
  OUTFIL FNAMES=ONLYF1,INCLUDE=(09,01,BI,EQ,X'FF'),                   
  OUTREC=(1,08)                                                       
  OUTFIL FNAMES=ONLYF2,INCLUDE=(01,01,BI,EQ,X'FF'),                   
  OUTREC=(09,09)                                                     
  OUTFIL FNAMES=MATCH,SAVE,                                           
  OUTREC=(01,08,16,2)                                                 
/*


Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Aug 25, 2005 6:41 am    Post subject: Reply with quote

Sharada,

If you get errors on the above job, you can try this job.

Code:

//STEP0100 EXEC PGM=SYNCTOOL                               
//TOOLMSG  DD SYSOUT=*                                     
//DFSMSG   DD SYSOUT=*                                     
//IN1      DD *                                           
100006US                                                   
300006UK                                                   
200006GR                                                   
//IN2      DD *                                           
200006 EU                                                 
400006 AS                                                 
//T1       DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE) 
//T2       DD DSN=&T2,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE) 
//CON      DD DSN=&T1,DISP=OLD,VOL=REF=*.T1               
//         DD DSN=&T2,DISP=OLD,VOL=REF=*.T2               
//MATCH    DD SYSOUT=*                                     
//UNMATCH  DD SYSOUT=*                                     
//TOOLIN   DD *                                           
  COPY FROM(IN1) USING(CTL1)                               
  COPY FROM(IN2) USING(CTL2)                               
  SORT FROM(CON) USING(CTL3)                               
//CTL1CNTL DD *                                           
  OUTFIL FNAMES=T1,OUTREC=(1,8,2Z)                         
//CTL2CNTL DD *                                           
  OUTFIL FNAMES=T2,OUTREC=(1,6,2Z,8,2)                     
//CTL3CNTL DD *                                           
  OPTION EQUALS                                           
  SORT FIELDS=(1,6,CH,A)                                   
  SUM FIELDS=(9,2,BI)                                     
  OUTFIL FNAMES=UNMATCH,                                   
  INCLUDE=(07,01,BI,EQ,X'00',OR,09,01,BI,EQ,X'00'),       
  OUTREC=(01,06)                                           
  OUTFIL FNAMES=MATCH,SAVE                                 
/*                                                         


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sharada
Beginner


Joined: 24 Aug 2005
Posts: 32
Topics: 14
Location: Hyderabad

PostPosted: Thu Aug 25, 2005 7:29 am    Post subject: HI KOLUSU, DIDN'T WORK Reply with quote

Hi Kolusu,

I am getting ABENDU0016
I am pasting the spool info.
Code:

SYSIN :                             
  JOINKEYS FILES=F1,FIELDS=(01,6,A) 
  *                                 
  JOINKEYS FILES=F2,FIELDS=(01,6,A) 
  *                                 
  REFORMAT FIELDS=(F1:1,08,         
   *                                                   
                    F2:1,09),FILL=X'FF'                 
   SORT FIELDS=(1,6,CH,A)                               
     JOIN UNPAIRED                                     
     *                                                 
     OUTFIL FNAMES=ONLYF1,INCLUDE=(09,01,BI,EQ,X'FF'), 
     OUTREC=(1,08)                                     
     OUTFIL FNAMES=ONLYF2,INCLUDE=(01,01,BI,EQ,X'FF'), 
     OUTREC=(09,09)                                     
     OUTFIL FNAMES=MATCH,SAVE,                         
     OUTREC=(01,08,16,2)                               
   /*                                                   
   *                                                   
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT       
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT       
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT       
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT       
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT       
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000   
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE   

and one more thing can you please explain me this,
thanks for your time.
Back to top
View user's profile Send private message
sharada
Beginner


Joined: 24 Aug 2005
Posts: 32
Topics: 14
Location: Hyderabad

PostPosted: Thu Aug 25, 2005 7:46 am    Post subject: hey its worked Reply with quote

Hi Kolusu,

Its worked to perfection.
Still I am confused with the code,
If you have time please explain.

Thanks.
Back to top
View user's profile Send private message
sharada
Beginner


Joined: 24 Aug 2005
Posts: 32
Topics: 14
Location: Hyderabad

PostPosted: Thu Aug 25, 2005 7:46 am    Post subject: Reply with quote

forgot to mention the
second example worked.
_________________
Regards,
Sharada.

Always perform your duty efficiently and without any selfish attachment to the results,
because by doing work without attachment one attains Supreme.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Aug 25, 2005 8:02 am    Post subject: Reply with quote

Sharada,

The first example might not have worked because of the syncsort version. Look in your sysout and the first line mentions the version of syncsort. The first example works only with SYNCSORT FOR Z/OS 1.2 . If your shop did have the SYNCSORT FOR Z/OS 1.2 then make sure that sysin control cards start from pos 2

Quote:

If you have time please explain.


Look at the 2nd post from bottom in the following topic which explains the logic.

http://mvsforums.com/helpboards/viewtopic.php?t=974&highlight=merge

You might also wanna check this topic

http://mvsforums.com/helpboards/viewtopic.php?t=10&highlight=merge

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sharada
Beginner


Joined: 24 Aug 2005
Posts: 32
Topics: 14
Location: Hyderabad

PostPosted: Thu Aug 25, 2005 8:08 am    Post subject: Reply with quote

Thank you very much
_________________
Regards,
Sharada.

Always perform your duty efficiently and without any selfish attachment to the results,
because by doing work without attachment one attains Supreme.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group