replace all constants with some other data - IBM AS400

This is a discussion on replace all constants with some other data - IBM AS400 ; hi, is there any way by which i can read a rpg(le) file and replace some particular data in the file. e.g if i wanted to replace all the constants in my program with some other data. i have been ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: replace all constants with some other data

  1. replace all constants with some other data

    hi,

    is there any way by which i can read a rpg(le) file and replace
    some particular data in the file.

    e.g if i wanted to replace all the constants in my program with some
    other data.

    i have been trying this in dspf and prtf. but i am facing this
    problem for rpg(le) program.
    i did some changes in rpgle program by converting it to flat file. but
    i dont know how to convert it back to rpgle program.

    thanks and regards
    upendra


  2. Re: replace all constants with some other data

    Hi,
    You can read the source file in a program & modify the program as you
    may want it.
    Read the file Library/SourceFile.memeber
    Eg SIDLIB/QRPGLESRC is the file, & the RPGLE program will be the
    memeber say QRPGLE1.

    When you read the file SIDLIB/QRPGLESRC for its memeber QRPGLE1 you
    will have 3 fields SRCSEQ SRCDAT SRCDTA. The SRCDTA will contain
    the program statements. You can have string check & change the
    required data.

    Let me know if this helps.
    Regards
    Siddhartha

    On Sep 18, 11:46 am, daredevilupen...@gmail.com wrote:
    > hi,
    >
    > is there any way by which i can read a rpg(le) file and replace
    > some particular data in the file.
    >
    > e.g if i wanted to replace all the constants in my program with some
    > other data.
    >
    > i have been trying this in dspf and prtf. but i am facing this
    > problem for rpg(le) program.
    > i did some changes in rpgle program by converting it to flat file. but
    > i dont know how to convert it back to rpgle program.
    >
    > thanks and regards
    > upendra




  3. Re: replace all constants with some other data

    that certainly is the hard way to do that.

    Why not use PDM to interactively view, search for the suspected data to be
    replaced, use the replace function to replace the data.

    That way you can check what it is your "think" you are changing before you
    actually commit to the change.

    STRPDM

    Find the rpg member in the source file.

    Use option 5 to just browse the file and search for that which you think you
    want to change, move through the file checking all the occurrences.
    There is even a option to print all the records with the occurrence of what
    you searched on.

    Then when you are satisfied that you will be changing the correct data,
    reopen the member using option 2 and then do the same search using the
    replace function.

    REMEMBER,RPG source statements are positional so you must replace data with
    exactly the same number of characters. (the right side of some RPGLE
    statements excepted.)

    Steve


    wrote in message
    news:1190097960.161089.69090@y42g2000hsy.googlegro ups.com...
    > hi,
    >
    > is there any way by which i can read a rpg(le) file and replace
    > some particular data in the file.
    >
    > e.g if i wanted to replace all the constants in my program with some
    > other data.
    >
    > i have been trying this in dspf and prtf. but i am facing this
    > problem for rpg(le) program.
    > i did some changes in rpgle program by converting it to flat file. but
    > i dont know how to convert it back to rpgle program.
    >
    > thanks and regards
    > upendra
    >




+ Reply to Thread