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 

Splice - Not getting correct result

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


Joined: 27 Dec 2002
Posts: 46
Topics: 15

PostPosted: Wed May 26, 2010 6:02 am    Post subject: Splice - Not getting correct result Reply with quote

Appreciate help.

I am doing a Splice operation
I am trying to Splice the following data of a file
Code:

00001
00002
00003

with another file which has the following data
Code:

00001  XXXXXXXXXXXXXXXX
00001  YYYYYYYYYYYYYYYY
00001  ZZZZZZZZZZZZZZZZ
00002  TTTTTTTTTTTTTTTT
00004  GGGGGGGGGGGGGGGG


The Desired Result is

Code:

00001  XXXXXXXXXXXXXXXX
00001  YYYYYYYYYYYYYYYY
00001  ZZZZZZZZZZZZZZZZ
00002  TTTTTTTTTTTTTTTT


Here is the code which I tried
Code:

000010 //STEP1    EXEC PGM=ICETOOL                       
000011 //TOOLMSG  DD SYSOUT=*                           
000012 //DFSMSG   DD SYSOUT=*                           
000013 //FILE1    DD *                                   
=COLS> ----+----1----+----2----+----3----+----4----+----5
000014 00001                                             
000015 00002                                             
000016 00003                                             
000017 //*                                               
000018 //FILE2    DD *     
=COLS> ----+----1----+----2----+----3----+----4----+----5
000019 00001  XXXXXXXXXXXXXXXX                           
000020 00001  YYYYYYYYYYYYYYYY                           
000021 00001  ZZZZZZZZZZZZZZZZ                           
000022 00002  TTTTTTTTTTTTTTTT                           
000023 00004  GGGGGGGGGGGGGGGG                           
000024 //*                                               
000025 //T1       DD DSN=&&T1,DISP=(MOD,PASS,DELETE),   
000026 //         UNIT=DISK,SPACE=(CYL,(1,1),RLSE)       
000027 //SHAR     DD SYSOUT=*                             
000028 //SYSOUT   DD SYSOUT=*                             
000029 //SYSPRINT DD SYSOUT=*                             
000030 //TOOLIN DD *                                     
000031   COPY FROM(FILE1) USING(CTL1)                     
000032   COPY FROM(FILE2) USING(CTL2)                     
000033   SPLICE FROM(T1) TO(SHAR) ON(1,5,CH) WITH(79,1) -
000034   WITHALL USING(CTL3)                             
000035 //*                                               
000036 //CTL1CNTL DD *                                   
000037   OPTION COPY                                     
000038   OUTFIL FNAMES=T1,OUTREC=(1:1,5,79:C'11')         
000039 //*                                               
000040 //CTL2CNTL DD *                                   
000041   OPTION COPY                                     
000042   OUTFIL FNAMES=T1,OUTREC=(1:1,32,79:C'22')       
000043 //CTL3CNTL DD *                                   
000044   SORT FIELDS=COPY                                 
000045   INCLUDE COND=(79,2,CH,EQ,C'21')                 
000046 //*


My above job returns 0 records.


Thanks
Novice
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed May 26, 2010 6:08 am    Post subject: Reply with quote

Novice,

CTL3 is being overridden with SORT FIELDS=COPY and it does NOT sort and your keys are not together and nothing is spliced. Remove it and re-run your job again.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Novice
Beginner


Joined: 27 Dec 2002
Posts: 46
Topics: 15

PostPosted: Wed May 26, 2010 9:00 am    Post subject: Reply with quote

Thanks Kolusu
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