Program Linkage

Parameter List

The parameter list begins with the Return Code(RC) - 2 characters. When the called program returns control, it tells why in the Return Code. The caller can direct the action of the called program through the initial value of the Return Code.

Return Status

Normally the RPG program returns control and stays active waiting to be called again. This is done to eliminate startup overhead. If the program is called with a Return Code of 99, it sets on LR and ends immediately. To stay active may require special first pass coding and/or coding to release record locks before returning. Active programs can be deactivated by a Reclaim Resources(RCLRSC) at a higher level in the program stack.

File Isolation

Separate inquiry programs are set up to extract data from each file. Other programs call these when the need file data. The inquiry program stays active with the file open, thereby avoiding repeated startup and file open overhead. It also reduces the number of access paths open to a file at any time. File changes are now isolated from functional programs for which they do not apply. This also allows standard defaults, overrides, and unique logical views of the database to be implemented without affecting functional programs.