Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
File Aid - Replacing One string with two strings/statements

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Compuware & Other Tools
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    Post subject: File Aid - Replacing One string with two strings/statements
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: 6968
Location: porcelain throne

PostPosted: Fri May 22, 2009 4:27 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Fri May 22, 2009 5:45 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Mon May 25, 2009 4:45 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Compuware & Other Tools All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts PLI %IF statements Pedro PL/I & Assembler 1 Tue Sep 19, 2017 12:06 am
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us