Program Status Data Structure
To allow the program to take necessary actions, it is necessary to define a program status data structure (PSDS) that provides program exception/error information.
The exception /errors can be Divide by zero, array index out-of-bound, Invalid Date, Time or Timestamp value. The PSDS must be defined in the main source section; therefore, there is only one PSDS per module.
DCL-DS *N PSDS;
PgmName Char(10) Pos(1);
UserName Char(10) Pos(254);
SysDate Zoned(6) Pos(276);
SysTime Zoned(6) Pos(282);
END-DS;
RPGPGM: New subfields added to Program Status Data Structure
IBM Site: Contents of the Program Status Data Structure
RPG Code in Fixed format for program status data structure in RPG