Accessing PL/I structures
The examples in this topic assume the following declaration for a structure called PAYROLL:
Declare 1 Payroll(100),
2 Name,
4 Last char(20),
4 First char(15),
2 Hours,
4 Regular Fixed Decimal(5,2),
4 Overtime Fixed Decimal(5,2);
To display the 10th element in the array, enter the following command:
LIST PAYROLL(10);z/OS® Debugger displays
the following results:LIST PAYROLL ( 10 );
PAYROLL.NAME.LAST(10)='Johnson '
PAYROLL.NAME.FIRST(10)='Eric '
PAYROLL.HOURS.REGULAR(10)='40'
PAYROLL.HOURS.OVERTIME(10)='0'
To display the first and last name of the 31st element in the array,
enter the following command:
LIST PAYROLL.NAME(31);z/OS Debugger displays
the following results:LIST PAYROLL.NAME ( 31 );
PAYROLL.NAME.LAST(31)='Rivers '
PAYROLL.NAME.FIRST(31)='Doug '
To display all the elements of the array by the order of each element
in the structure, enter the following command:
LIST PAYROLL;z/OS Debugger displays
results similar to the following list, with ellipses (...) used to
indicate that additional information has been removed from this list
to condense the list:LIST PAYROLL;
PAYROLL.NAME.LAST(1)='Smith '
PAYROLL.NAME.LAST(2)='Ramirez '
PAYROLL.NAME.LAST(3)='Patel '
...
PAYROLL.NAME.LAST(100)='Li '
PAYROLL.NAME.FIRST(1)='Jason '
PAYROLL.NAME.FIRST(2)='Ricardo '
PAYROLL.NAME.FIRST(3)='Aisha '
...
PAYROLL.NAME.FIRST(100)='Xian '
PAYROLL.HOURS.REGULAR(1)='40'
PAYROLL.HOURS.REGULAR(2)='40'
PAYROLL.HOURS.REGULAR(3)='40'
...
PAYROLL.HOURS.REGULAR(100)='40'
PAYROLL.HOURS.OVERTIME(1)='0'
PAYROLL.HOURS.OVERTIME(2)='2'
PAYROLL.HOURS.OVERTIME(3)='3'
...
PAYROLL.HOURS.OVERTIME(100)='0'
To display all the elements of the array by the order in which the information is stored in memory, enter the following commands:
SET LIST BY SUBSCRIPT ON;
LIST PAYROLL;
z/OS Debugger displays results similar to the following list, with ellipses (...) used to indicate that additional information has been removed from this list to condense the list:
LIST PAYROLL;
PAYROLL.NAME.LAST(1)='Smith '
PAYROLL.NAME.FIRST(1)='Jason '
PAYROLL.HOURS.REGULAR(1)='40'
PAYROLL.HOURS.OVERTIME(1)='0'
PAYROLL.NAME.LAST(2)='Ramirez '
PAYROLL.NAME.FIRST(2)='Ricardo '
PAYROLL.HOURS.REGULAR(2)='40'
PAYROLL.HOURS.OVERTIME(2)='2'
PAYROLL.NAME.LAST(3)='Patel '
PAYROLL.NAME.FIRST(3)='Aisha '
PAYROLL.HOURS.REGULAR(3)='40'
PAYROLL.HOURS.OVERTIME(3)='3'
...
PAYROLL.NAME.LAST(100)='Li '
PAYROLL.NAME.FIRST(100)='Xian '
PAYROLL.HOURS.REGULAR(100)='40'
PAYROLL.HOURS.OVERTIME(100)='0'