Category:RPG

From MidrangeWiki
Revision as of 05:03, 3 April 2005 by Pbhall (talk | contribs) (Program Status Data Structure)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Program Status Data Structure

This structure contains subfiled that contain a lot of information about the current program and the job it's running in. I find it's the easiest way to get the program name for sending notifications, identifying the job name, the job or current user, and exception information.

You declare it in the data definition section of the program like this:

     * Program Status Data Structure
    D                SDS

List the sub-fields you need below that. They're described in the ILE RPG language reference.

Declaring an externally described data structure allows you to use any of the information in the program status data structure without worrying about sub-field locations. You just add a declaration like this to your program:

     * Program Status Data Structure
    D PSDS          ESDS

And make the data structure template file available during the compile.