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 

Alternate for splice

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


Joined: 04 Feb 2005
Posts: 31
Topics: 10

PostPosted: Wed Aug 27, 2008 7:41 am    Post subject: Alternate for splice Reply with quote

Hello all,

I am using following JCL to get the matching records between two files. My file1 has only 20000 accounts and my file2 has over 168,000,000 records (both are in sorted). I am trying to get all the records from files2 that match with file1.

Main prblem with this JCL is it takes too much workspace, and kept on failing when space is not available. Is there any other efficient way of doing this? (Writing a program could solve my problem, but i am trying to do this using IBM utilities)

Code:

//STEP01   EXEC  PGM=ICETOOL   
//SYSPRINT DD SYSOUT=*         
//SYSOUT   DD SYSOUT=*         
//TOOLMSG  DD SYSOUT=*         
//DFSMSG   DD SYSOUT=*         
//DFSPARM  DD *               
  OPTION DYNALLOC=(SYSDA,20)   
//IN1      DD DISP=SHR,DSN=file1
//IN2      DD DISP=SHR,DSN=file2
//OUT      DD DSN=outfile,               
//            DISP=(NEW,CATLG),                                       
//            DCB=file2,               
//            DATACLAS=PRDCNORM                                       
//TEMP1  DD DSN=&&TEMP1,DISP=(MOD,PASS),                           
//           DATACLAS=PRDCNORM,DCB=LRECL=9201,RECFM=FB)             
//TOOLIN   DD *                                                       
  COPY FROM(IN1) TO(TEMP1) USING(CTL1)                               
  COPY FROM(IN2) TO(TEMP1) USING(CTL2)                               
  SPLICE FROM(TEMP1) TO(OUT) ON(1,22,CH) -                           
   WITH(1,9200) USING(CTL3) WITHALL                                   
//CTL1CNTL DD *                                                       
  INREC BUILD=(1:1,22,9201:C'X')                                     
/*                                                                   
//CTL2CNTL DD *                                                       
  INREC OVERLAY=(9201:C'Y')                                           
/*                                                                   
//CTL3CNTL DD *                                                       
  OUTFIL FNAMES=OUT,                                                 
  INCLUDE=(9201,1,CH,EQ,C'X'),                                       
  BUILD=(1,9200)                                                     
/*                                                                   
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Aug 27, 2008 10:23 am    Post subject: Reply with quote

Given that "both are in sorted" means both files are already in sorted order by the 1,22,CH field, you could try this DFSORT/ICETOOL job ... it will use a MERGE for the SPLICE instead of a SORT, so it won't use sort work data sets.

Code:

//STEP01   EXEC  PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//IN1 DD DISP=SHR,DSN=file1
//IN2 DD DISP=SHR,DSN=file2
//CTL3IN01 DD DSN=&&T1,DISP=(,PASS),
//      DATACLAS=PRDCNORM
//CTL3IN02 DD DSN=&&T2,DISP=(,PASS),
//      DATACLAS=PRDCNORM
//DUMMY DD DUMMY
//OUT      DD DSN=outfile,
//            DISP=(NEW,CATLG),
//            DCB=file2,
//            DATACLAS=PRDCNORM
//TOOLIN   DD *
  COPY FROM(IN1) TO(CTL3IN01) USING(CTL1)
  COPY FROM(IN2) TO(CTL3IN02) USING(CTL2)
  SPLICE FROM(DUMMY) TO(OUT) ON(1,22,CH) -
   WITH(1,9200) USING(CTL3) WITHALL
/*
//CTL1CNTL DD *
  INREC BUILD=(1:1,22,9201:C'X')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(9201:C'Y')
/*
//CTL3CNTL DD *
  MERGE FIELDS=(1,22,CH,A)
  OUTFIL FNAMES=OUT,
    INCLUDE=(9201,1,CH,EQ,C'X'),
    BUILD=(1,9200)
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
hchinnam
Beginner


Joined: 04 Feb 2005
Posts: 31
Topics: 10

PostPosted: Thu Aug 28, 2008 10:56 am    Post subject: Reply with quote

Brilliant.

Thanks Frank.
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