60 pts.
 Want to find a string in CL source file(ABOUT 400 CL SOURCE ) and replace with other String.
I Have a problem For replacing a particular Hard coded Libray name from my all CL source file(about 400) by some other hardcoded library name.For e.g There is a library name Used in many CL source file with ABCD(lib name).I want to change all occurances in each CL source file By DEFG.

Software/Hardware used:
as400,rpg,CL
ASKED: December 4, 2012  12:41 PM
UPDATED: December 4, 2012  12:43 PM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question. fsddfsdfsd   60 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

What OS release are you running? Do you have a RUNSQL command? Do you have PDM installed, or do you use RDi? — Tom

 108,360 pts.

 

Fairly easy thing to do if you are using PDM. We do it every time there is a new software release.Open source file library and flag first member with a 25. Then F13 to flag all members in the source file. Enter the text you want to find and change OPTION to 2 ,  PRINT LIST = Y.When it stops on a source member your text is found in do a F14 (shift + F2) find/replace.  And check allow data shift Y.When changes are made, F3 to exit and save changes.Then go back and recompile the code after all your source members have been changed you can either use the list  from the search or just recompile all source in the library which ever works best for you..Hope it helps

 3,915 pts.

 

Then F13 to flag all members in the source file. Enter the text you want to find and change OPTION to 2 …
 
Up to the point of entering Option=2, that’s the direction I’d go. Given the description of the problem, using the PDM update option in any manual mode is very inefficient and time consuming. Other options are probably much better, depending on what the OP has available as tools.
 
Tom

 108,360 pts.

 

@ToddN2000….I agree with Your solution but the thing is that we have to do it manually.Can We auotmate it my some Logic or any other means.
@TomLiotta…Please suggest Any other way Which can be done.Wha ToddN2000 suggested is some thing which will take time as string to be replaced is in large number

 60 pts.

 

I would do the same as ToddN2000 except I would use Option=XR. I would have a user-defined PDM option named XR (or any valid option name) that was a CL that received library, file and member as parms. First statement would be OVRDBF to override to the member. Last statement would be DLTOVR to delete the override. The OVRDBF/DLTOVR would wrap a RUNSQL command that issued an UPDATE statement that replaced all occurrences of ABCD with DEFG in that member. That’s all there is to it, but it depends on what you have available. — Tom

 108,360 pts.