How to understand RPG2 Logic

2900 pts.
Tags:
AS/400
ILE
RPG
Hi all,
I am suppose to update some RPG2 code written in 80s. I want to know how I can understand program logic quickly. Actually I am use to of coding in free format ILE. Unfortunately it is a very big code which I have to understand for later modifications and also I am not allowed to convert it to ILE due to some management psychological issue.
Thanks,
0

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.

Discuss This Question: 10  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.
  • philpl1jb
    1. If you have a file coded with the file type P for primary .. then it will be read by the cycle.
    54,090 pointsBadges:
    report
  • ToddN2000
    It's been many years since I coded in RPG I or RPG II (1981).

    What is the code that is giving you problems. Other than what Philpl1jb mentioned there are other things like level breaks L1, L2... 

    There were 'E' spec records for defining table and arrays. 

    You had an H1 indicator.

    Code that old may not be the most efficient, what reason are they giving you for not re-writing it to ILE?
    134,495 pointsBadges:
    report
  • philpl1jb

    2. if the field type is 'S' then it's a secondary file that is read automatically .. not so keen on this.

    54,090 pointsBadges:
    report
  • philpl1jb
    3. O specs can be automatically run and can clear fields.
    54,090 pointsBadges:
    report
  • azohawk
    No subroutines and most things are conditioned based on left side indicators. You have my sympathy.
    4,055 pointsBadges:
    report
  • philpl1jb

    4. File structure maybe defined in I-specs

    54,090 pointsBadges:
    report
  • Splat
    Do you have level breaks (indicators L1 through L9) or matching records (indicators M1 through M9)?

    I've run into that particular management phobia - it tends to make life . . . interesting.
    12,915 pointsBadges:
    report
  • ToddN2000
    L1 - L9 were used to control a break in the file key processing.Like a change in customer #. This allowed for things like subtotals or page breaks and anything else you may have wanted to group together.
    134,495 pointsBadges:
    report
  • hunshabbir7
    Thanks all of you for replying... I have no issue with code. Most of the new things were tables, arrays and a lot of indicators with few other things which come across for first time; I already understood them. What I am trying to understand is business logic... I wanted to ask that how I can split up code in smaller pieces to understand whats actually happening.
    2,900 pointsBadges:
    report
  • ToddN2000
    With old code, it's hard to break down due to the lack of subroutines, stored procedures ans copybook (external code). My suggestion would be to start by following the "L" indicators being used. What branch in logic happens, see if any summary/total calculations are done then is any specific output generated for each "L" break. I feel your pain working with code that old... Just curious, how large is the program?
    134,495 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.

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

Following

Share this item with your network: