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 

Help:Need to replace chars in a PS

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


Joined: 09 May 2007
Posts: 10
Topics: 3

PostPosted: Fri Nov 02, 2007 8:05 am    Post subject: Help:Need to replace chars in a PS Reply with quote

I have 2 Input files
File1:
Code:

1234567890
9874561230
6549873210


File2
Code:

ABC
DEF
GHI


My output file should look like
Code:

12ABC67890
98DEF61230
65GHI73210


ie.i want to REPLACE the characters say from position 3 to 5 in the File1 with the values in File2.
Please advice me on how to proceed.
Back to top
View user's profile Send private message
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Fri Nov 02, 2007 8:25 am    Post subject: Reply with quote

pulsar,

Try this job:

Code:


//STEP0100 EXEC PGM=ICETOOL                                           
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN1      DD *                                                       
1234567890                                                             
9874561230                                                             
6549873210                                                             
//IN2      DD *                                                       
ABC                                                                   
DEF                                                                   
GHI                                                                   
//T1       DD DSN=&T1,DISP=(MOD,PASS),UNIT=SYSDA,SPACE=(CYL,(5,5),RLSE)
//OUT      DD SYSOUT=*                                                 
//TOOLIN   DD *                                                       
  COPY FROM(IN1) TO(T1) USING(CTL1)                                   
  COPY FROM(IN2) TO(T1) USING(CTL2)                                   
  SPLICE FROM(T1) TO(OUT) ON(101,8,PD) WITH(21,03) USING(CTL3)         
//CTL1CNTL DD *                                                       
  OUTREC FIELDS=(1:1,20,101:SEQNUM,8,PD)                               
//CTL2CNTL DD *                                                       
  OUTREC FIELDS=(21:1,20,101:SEQNUM,8,PD)         
//CTL3CNTL DD *                                   
  OUTFIL FNAMES=OUT,OUTREC=(1:1,2,3:21,3,6:6,5)   
/*                                               


_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
pulsar
Beginner


Joined: 09 May 2007
Posts: 10
Topics: 3

PostPosted: Fri Nov 02, 2007 8:43 am    Post subject: Reply with quote

Thanks Vivek G for your quick response.
Unfortunately ICETOOL is not available in my system Sad
Back to top
View user's profile Send private message
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Fri Nov 02, 2007 9:12 am    Post subject: Reply with quote

pulsar,

Replace ICETOOL with SYNCTOOL and try.
_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
pulsar
Beginner


Joined: 09 May 2007
Posts: 10
Topics: 3

PostPosted: Fri Nov 02, 2007 9:32 am    Post subject: Reply with quote

Thanks Vivek - It worked fine when i gave
Code:

//OUT      DD SYSOUT=*


But when i gave
Code:

//OUT      DD ..a flat file


it throws
Code:

  SPLICE FROM(T1) TO(OUT) ON(101,8,PD) WITH(21,03) USING(CTL3)         
SYNCSORT CALLED WITH IDENTIFIER "0003"                                 
SYNCSORT COMPLETED UNSUCCESSFULLY                                     
OPERATION COMPLETED WITH RETURN CODE 16                               
                                                                       
PROCESSING MODE CHANGED FROM "STOP" TO "SCAN" DUE TO OPERATION FAILURE
Back to top
View user's profile Send private message
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Fri Nov 02, 2007 9:37 am    Post subject: Reply with quote

pulsar,

You need to post the DFSMSG messages.

Quote:

//OUT DD ..a flat file


Can u also post us the other parameters associated with the flat file, like DCB parm, LRECL, etc?
_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
pulsar
Beginner


Joined: 09 May 2007
Posts: 10
Topics: 3

PostPosted: Fri Nov 02, 2007 9:46 am    Post subject: Reply with quote

my DEFMSG
Code:
T1       : RECFM=FB   ; LRECL=  1000; BLKSIZE= 30000   
OUT      : RECFM=FB   ; LRECL=  1000; BLKSIZE= 27000   
OUT      HAS INCOMPATIBLE LRECL                       
SYNCSMF  CALLED BY SYNCSORT; RC=0000                   


OP file
Code:

//OUT      DD DSN=Outputfile,           
//             DISP=(NEW,CATLG),UNIT=SYSDAT,       
//             SPACE=(1000,(20,20),RLSE),AVGREC=K,
//             DCB=(LRECL=1000,BLKSIZE=0,RECFM=FB)
Back to top
View user's profile Send private message
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Fri Nov 02, 2007 9:59 am    Post subject: Reply with quote

pulsar
Comment out the DCB paramenter and run the same JOB. LRECL will be decided dynamically.
_________________
cHEERs
krisprems
Back to top
View user's profile Send private message
pulsar
Beginner


Joined: 09 May 2007
Posts: 10
Topics: 3

PostPosted: Fri Nov 02, 2007 10:02 am    Post subject: Reply with quote

Thanks a lot krisprems. It worked Smile
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