IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

File Aid - Replacing One string with two strings/statements


IBM Mainframe Forums -> Compuware & Other Tools
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
suchita_thorat

New User


Joined: 22 Feb 2008
Posts: 11
Location: Pune,India

PostPosted: Fri May 22, 2009 3:45 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri May 22, 2009 4:27 pm
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri May 22, 2009 5:45 pm
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon May 25, 2009 4:45 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Compuware & Other Tools

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top