|
View previous topic :: View next topic
|
| Author |
Message |
suchita_thorat
New User
Joined: 22 Feb 2008 Posts: 11 Location: Pune,India
|
|
|
|
Hi all,
We want to use File aid for replacing single string by two strings/statements.
e.g.
| Code: |
| //STEPLIB DD DISP=SHR,DSN=xxxx.USR.LOADLIB |
should change to -
| Code: |
//STEPLIB DD DISP=SHR,DSN=yyyy.REFR.DSNS
// DD DISP=SHR,DSN=yyyy.REFR.DSNLOAD |
whenever it encounter string 'xxxx.USR.LOADLIB'
i.e string 'xxxx.USR.LOADLIB' should be replaced with string 'yyyy.REFR.DSNS' and next line '// DD DISP=SHR,DSN=yyyy.REFR.DSNLOAD' both.
How we can achieve it?
I believe we can not use EDITALL for these kind of thing. Please Help.
Thanks in advance.
Regards,
Suchita |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
I don't think FileAid has an option to INSERT a statement.
If it does, that is your solution - to continue maintaining substandard JCL.
The INCLUDE JCL statement was developed to solve this kind of problem.
That you have not 'converted' your old-style JCL, yet,
is a problem that will continue to haunt you.
I would suggest replacing the 'out-dated' STEPLIB, JOBLIB, etc... statements
with a well thought-out INCLUDE methodology.
That you could accomplish with FileAid. |
|
| Back to top |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
here is a FILEAID that will insert the extra line, you can then replace the first string using EDITALL.
| Code: |
//STEP0001 EXEC PGM=FILEAID
//SYSPRINT DD SYSOUT=*
//DD01 DD DSN=pds1,DISP=SHR
//DD01O DD DSN=pds2,
// DISP=(,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(10,5,10),RLSE),
// DCB=(RECFM=FB,LRECL=80)
//SYSIN DD *
$$DD01 USER PADCHAR=C' ',
WRITE=DD01O,
IF=(001,0,C"XXXX.USR.LOADLIB"),
MOVE=(01,C"// DD DISP=SHR,DSN=YYYY.REFR.DSNL"),
WRITE=DD01O
/*
|
Gerry |
|
| Back to top |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
here is another example that will do what you want in one step.
| Code: |
$$DD01 USER OUT=0,
IF=(001,EQ,C"//STEPLIB DD DISP=SHR,DSN=XXXX.USR.LOADLIB"),
MOVE=(1,080C' '),
MOVE=(01,C"//STEPLIB DD DISP=SHR,DSN=YYYY.REFR.DSNS"),
WRITE=DD01O,
IF=(001,EQ,C"//STEPLIB DD DISP=SHR,DSN=XXXX.USR.LOADLIB"),
MOVE=(1,080C' '),
MOVE=(01,C"// DD DISP=SHR,DSN=YYYY.REFR.DSNLOAD"),
WRITE=DD01O,
IF=(001,NE,C"//STEPLIB DD DISP=SHR,DSN=XXXX.USR.LOADLIB"),
WRITE=DD01O
|
Gerry |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|