View previous topic :: View next topic |
Author |
Message |
pulsar Beginner
Joined: 09 May 2007 Posts: 10 Topics: 3
|
Posted: Fri Nov 02, 2007 8:05 am Post subject: Help:Need to replace chars in a PS |
|
|
I have 2 Input files
File1:
Code: |
1234567890
9874561230
6549873210
|
File2
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 |
|
|
vivek1983 Intermediate
Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Fri Nov 02, 2007 8:25 am Post subject: |
|
|
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 |
|
|
pulsar Beginner
Joined: 09 May 2007 Posts: 10 Topics: 3
|
Posted: Fri Nov 02, 2007 8:43 am Post subject: |
|
|
Thanks Vivek G for your quick response.
Unfortunately ICETOOL is not available in my system |
|
Back to top |
|
|
vivek1983 Intermediate
Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Fri Nov 02, 2007 9:12 am Post subject: |
|
|
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 |
|
|
pulsar Beginner
Joined: 09 May 2007 Posts: 10 Topics: 3
|
Posted: Fri Nov 02, 2007 9:32 am Post subject: |
|
|
Thanks Vivek - It worked fine when i gave
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 |
|
|
vivek1983 Intermediate
Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Fri Nov 02, 2007 9:37 am Post subject: |
|
|
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 |
|
|
pulsar Beginner
Joined: 09 May 2007 Posts: 10 Topics: 3
|
Posted: Fri Nov 02, 2007 9:46 am Post subject: |
|
|
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 |
|
|
krisprems Beginner
Joined: 13 Dec 2006 Posts: 101 Topics: 4 Location: india
|
Posted: Fri Nov 02, 2007 9:59 am Post subject: |
|
|
pulsar
Comment out the DCB paramenter and run the same JOB. LRECL will be decided dynamically. _________________ cHEERs
krisprems |
|
Back to top |
|
|
pulsar Beginner
Joined: 09 May 2007 Posts: 10 Topics: 3
|
Posted: Fri Nov 02, 2007 10:02 am Post subject: |
|
|
Thanks a lot krisprems. It worked |
|
Back to top |
|
|
|
|