ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

RPGLE program that edits rpg source code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • RPGLE program that edits rpg source code

    Is there anyway I can open an RPG source file using an RPG ILE program and read the source code line by line so I can edit it then save the source file? If I cannot edit the source file using RPG ILE what would I be able to use?

  • #2
    Re: RPGLE program that edits rpg source code

    Originally posted by gtank
    Is there anyway I can open an RPG source file using an RPG ILE program and read the source code line by line so I can edit it then save the source file? If I cannot edit the source file using RPG ILE what would I be able to use?
    Sure. Just Google the keyword "srcdta" and you'll get lots of examples.
    "Time passes, but sometimes it beats the <crap> out of you as it goes."

    Comment


    • #3
      Re: RPGLE program that edits rpg source code

      source files are basically a multiple member phsical file that has three fields...
      srcdta (the large field) srcdat(the date on the far right in pdm) and srcseq (the sequence number on the left)

      so that said....

      just place QRPGSRC up in your F specs with a rename of the format of course and a usropn use ovrdbf (qcmdexc) to override to the member you want to read.
      Then just read and process.

      kinda simple explanation I know
      but here is an example that writes to a source member just reverse the logic...



      Welcome to code400 happy holidays
      Jamie
      All my answers were extracted from the "Big Dummy's Guide to the As400"
      and I take no responsibility for any of them.

      www.code400.com

      Comment


      • #4
        Re: RPGLE program that edits rpg source code

        Hey Jamie,
        I was having a brainstorm today about writing a really small and clean source dependency program when I found this page in google. The link in your post is FatGeeked. Not sure what happened to it. You think its laying around anywhere?
        Your future President
        Bryce

        ---------------------------------------------
        http://www.bravobryce.com

        Comment


        • #5
          Re: RPGLE program that edits rpg source code

          Ill drop it out there for you -- it wont be perfect cause the header & footer have changed.
          Its on my list of things never to complete
          this be OLD non free code...

          should be there now

          jamie
          All my answers were extracted from the "Big Dummy's Guide to the As400"
          and I take no responsibility for any of them.

          www.code400.com

          Comment


          • #6
            Re: RPGLE program that edits rpg source code

            If your on V5R1 or above you don't need to do the override anymore you can specify EXTMBR on the F spec.

            Comment

            Working...
            X