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 

write Matching records in output using SPLICE

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


Joined: 15 Oct 2004
Posts: 29
Topics: 8

PostPosted: Fri Mar 30, 2007 9:33 am    Post subject: write Matching records in output using SPLICE Reply with quote

Hi,

I need to compare two files on first 9 bytes and write only the matching records from first file (of 25 bytes) to the output file.

I tried writinga DFSORT JCL using SPLICE but keep getting Following error: OPEN ERROR SYSIN

My input file structure is

File 1: LRECL: 25
Code:
----+----1----+----2----+
000038156N274622948048972
000038156Y706784028025244
000065932Y848979845546364
000065932N853068260933980
000065932N058584761303356
000066844N399034638303276
000066844N399034638303292
000066844Y043995318289500
000069676N583032537088028
000069676Y600752785621068


File 2:LRECL: 9

Code:
----+----
000001102
000001146
000001342
000001351
000001357
000001419
000001423
000001654
000001658
000001924
000002133
000002405

Code:

//STEP02  EXEC PGM=SORT                                     
//*                                                         
//TOOLMSG DD SYSOUT=*                                       
//DFSMSG  DD SYSOUT=*                                       
//SYSOUT  DD SYSOUT=*                                       
//*                                                         
//IN1 DD DISP=SHR,DSN=<File1>
//IN2 DD DISP=SHR,DSN=<File2>
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=<Output File>                       
//    DISP=(NEW,CATLG,DELETE),                               
//    UNIT=SYSDA,SPACE=(CYL,(20,6),RLSE),                   
//    DCB=(BLKSIZE=0,LRECL=25,RECFM=FB)                     
//TOOLIN   DD *                                             
COPY FROM(IN1) TO(T1) USING(CTL1)                           
COPY FROM(IN2) TO(T1) USING(CTL2)                           
SPLICE FROM(T1) TO(OUT) ON(1,9,CH) -                         
  USING(CTL3)                                               
//*                                                         
//CTL1CNTL DD *                                             
  INREC BUILD=(1:1,25)         
//*                             
//CTL2CNTL DD *                 
  INREC BUILD=(1:1,09)         
//*                             
//CTL3CNTL DD *                 
  OUTFIL FNAMES=OUT,BUILD=(1,25)
/*                             
//*                             


Can anyone help me solving this issue?


Regs
Oscorp
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: Fri Mar 30, 2007 9:52 am    Post subject: Reply with quote

Oscorp,

Isn't this the similar question to what thrivikram posted here?

http://www.mvsforums.com/helpboards/viewtopic.php?t=8141

The reason your job failed is because your are trying to concatenate 2 different lrecl files

Try this job,

Code:

//STEP0100 EXEC PGM=ICETOOL                                 
//TOOLMSG  DD SYSOUT=*                                     
//DFSMSG   DD SYSOUT=*                                     
//IN1      DD *                                             
000038156N274622948048972                                   
000038156Y706784028025244                                   
000065932Y848979845546364                                   
000065932N853068260933980                                   
000065932N058584761303356                                   
000066844N399034638303276                                   
000066844N399034638303292                                   
000066844Y043995318289500                                   
000069676N583032537088028                                   
000069676Y600752785621068                                   
//IN2      DD *                                             
000038156                                                   
000066844                                                   
000001342                                                   
000001351                                                   
000001357                                                   
000001419                                                   
000001423                                                   
000001654                                                   
000001658                                                   
000001924                                                   
000002133                                                   
000002405                                                   
//T1       DD DSN=&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)
//OUT      DD SYSOUT=*                                     
//TOOLIN   DD *                                         
  COPY FROM(IN2) TO(T1) USING(CTL2)                     
  COPY FROM(IN1) TO(T1) USING(CTL1)                     
  SPLICE FROM(T1) TO(OUT) ON(1,9,CH) WITH(1,25) WITHALL -
  USING(CTL3)                                           
//CTL1CNTL DD *                                         
  INREC BUILD=(01,25,9X)                                 
//CTL2CNTL DD *                                         
  INREC BUILD=(01,09,25:X,01,09)                         
//CTL3CNTL DD *                                         
  OUTFIL FNAMES=OUT,                                     
  INCLUDE=(01,09,CH,EQ,26,09,CH),                       
  BUILD=(01,25)                                         
/*                                                       


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
OSCORP
Beginner


Joined: 15 Oct 2004
Posts: 29
Topics: 8

PostPosted: Fri Mar 30, 2007 11:17 am    Post subject: Reply with quote

Hi Kolusu,

ThankS a lot for the quick reply...
But I am still getting the OPEN SYSIN Error.

I guess thrivikram has posted the same query as mine...but I overlooked it while doing the search

regs
Oscorp
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: Fri Mar 30, 2007 11:44 am    Post subject: Reply with quote

Quote:
But I am still getting the OPEN SYSIN Error.


That's because you have PGM=SORT instead of PGM=ICETOOL! This is an ICETOOL job, so you must have PGM=ICETOOL as Kolusu does. With PGM=SORT, DFSORT is executed instead of DFSORT's ICETOOL and it looks for SYSIN and doesn't find it.
_________________
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
OSCORP
Beginner


Joined: 15 Oct 2004
Posts: 29
Topics: 8

PostPosted: Sat Mar 31, 2007 6:33 pm    Post subject: Reply with quote

Thanks a lot Kolusu,kolusu...

Regs

Oscorp
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