+-------------------------------IBM Extension--------------------------------+
The PROGRAM STATUS clause specifies a data item into which values from the predefined program status structure are moved after an error occurs in the program.
PROGRAM STATUS Clause - Format
>>-PROGRAM STATUS--+----+--data-name-1--+-----------------------------------+-><
'-IS-' '-START POSITION--+----+--integer-1-'
'-IS-'
If the PROGRAM STATUS clause is specified in the SPECIAL-NAMES paragraph, data-name-1 is updated with values
from the predefined program status structure. This structure contains
subfields that provide you with information about the program exception/error
that occurred. Table 6 provides the layout of the subfields of the data structure and the
information that it contains.
Table 6. Contents of the Program Status Data Structure
| Start position | Length | Format | Description |
| 0 | 10 | Character | Program name. |
| 10 | 10 | Character | Program library name. |
| 20 | 10 | Character | Module name. |
| 30 | 10 | Character | Statement number. *N if not available. |
| 40 | 6 | Character | Optimization level. |
| 46 | 7 | Character | Exception message identifier. |
| 53 | 10 | Character | Job name. |
| 63 | 6 | Character | Job number. |
| 69 | 1 | Character | Job type. |
| 70 | 10 | Character | User profile running the program. |
| 80 | 14 | Character | Timestamp (in the format YYYYMMDDHHMMSS) for the time that the error occurred. |
You select the subfield(s) from the program status structure that gets moved into data-name-1 by coding its length and the start position. The compiler uses the length and start position to determine the program status subfield(s) that data-name-1 gets mapped onto. The length and start position must match one or more predefined subfields of the program status structure.
+----------------------------End of IBM Extension----------------------------+
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.