Want to find a string in CL source file(ABOUT 400 CL SOURCE ) and replace with other String.

60 pts.
Tags:
AS/400
cl 400
RPG
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

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    What OS release are you running? Do you have a RUNSQL command? Do you have PDM installed, or do you use RDi? -- Tom
    125,585 pointsBadges:
    report
  • ToddN2000
    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
    9,700 pointsBadges:
    report
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • fsddfsdfsd
    @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 pointsBadges:
    report
  • TomLiotta
    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
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following