PSDS Example

To specify a PSDS in your program, you code the program status data structure and the subfields you wish to use on a definition specification.

Figure 1. Example of Coding a PSDS
DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++Comments++++++++++

DMYPSDS          SDS

D PROC_NAME         *PROC                                                  * Procedure name

D PGM_STATUS        *STATUS                                                * Status code

D PRV_STATUS             16     20S 0                                      * Previous status

D LINE_NUM               21     28                                         * Src list line num

D ROUTINE           *ROUTINE                                               * Routine name

D PARMS             *PARMS                                                 * Num passed parms

D EXCP_TYPE              40     42                                         * Exception type

D EXCP_NUM               43     46                                         * Exception number

D PGM_LIB                81     90                                         * Program library

D EXCP_DATA              91    170                                         * Exception data

D EXCP_ID               171    174                                         * Exception Id

D DATE                  191    198                                         * Date (*DATE fmt)

D YEAR                  199    200S 0                                      * Year (*YEAR fmt)

D LAST_FILE             201    208                                         * Last file used

D FILE_INFO             209    243                                         * File error info

D JOB_NAME              244    253                                         * Job name

D USER                  254    263                                         * User name

D JOB_NUM               264    269S 0                                      * Job number

D JOB_DATE              270    275S 0                                      * Date (UDATE fmt)

D RUN_DATE              276    281S 0                                      * Run date (UDATE)

D RUN_TIME              282    287S 0                                      * Run time (UDATE)

D CRT_DATE              288    293                                         * Create date

D CRT_TIME              294    299                                         * Create time

D CPL_LEVEL             300    303                                         * Compiler level

D SRC_FILE              304    313                                         * Source file

D SRC_LIB               314    323                                         * Source file lib

D SRC_MBR               324    333                                         * Source file mbr

D PROC_PGM              334    343                                         * Pgm Proc is in

D PROC_MOD              344    353                                         * Mod Proc is in
Note: The keywords are not labels and cannot be used to access the subfields. Short entries are padded on the right with blanks.