Finding the program name and compile time stamp in Enterprise COBOL V5 or V6 programs
You can find the program name (and PPA1) for COBOL V5 or V6 programs at run time.
- From the current Register 13, follow the backchain pointer (R13 + 4).
- The Entry Point address (EP@) is in the backchain, in the R15 slot (backchain address + 16).
- At the EP@, look at the word in EP@+12. An integer is there, which is the offset from the entry point to the PPA1 in this program.
- Add this integer to the EP@. This is the PPA1 address.
- The program name is in the PPA1. (The first byte in PPA1 times 2 (byte *2) gives the offset of the program name in PPA1.)
- The first 2 bytes of the program name are the length of the name, followed by the name.