If you compiled your code with the RENT option, static variables are located in the WSA (the Writeable Static Area) for the current load module. The offset of a variable within the WSA can be found from the output of the MAP option, and the WSA is held in the Language Environment control block called the CAA. The value of the WSA is also listed in the Language Environment dump.
However, if you compiled your code with the NORENT option, EXTERNAL STATIC is found as usual (using the linker listing and the output of the compiler's MAP option). INTERNAL STATIC will be dumped as part of the Language Environment dump (if PLIDUMP was called with the B option).
Please also note that unlike the older PL/I compilers, the address of static is not dedicated to any one register.
For example, consider the program above with the variables changed to STATIC:
Compiler Source
Line.File
2.0 test: proc options(main);
3.0
4.0 dcl a fixed bin(31) static;
5.0 dcl b fixed bin(31) static;
6.0
7.0 on error
8.0 begin;
9.0 call plidump('TFBC');
10.0 end;
11.0
12.0 a = 0;
13.0 b = 29;
14.0 b = 17 / a;
When compiled with the NORENT option, the result of the compiler MAP option for this program looks like this, except that there is actually one more column on the right and the columns are actually spaced much further apart:
* * * * * S T O R A G E O F F S E T L I S T I N G * * * * * IDENTIFIER DEFINITION ATTRIBUTES A 1-0:4 Class = static, Location = 0 : 0x0 + CSECT ***TEST2 B 1-0:5 Class = static, Location = 4 : 0x4 + CSECT ***TEST2
So, A is located at hex offset 00 into the static CSECT for the compilation unit TEST while B is located at hex offset 04.
Since in this program PLIDUMP is called with the B option, it will include a hexadecimal dump of static storage for each compilation in the current calling chain. This will look like (again with the right columns cutoff):
Static for procedure TEST Timestamp: 2004.08.12
+000000 0FC00AA0 00000000 0000001D 0FC00DC8 0FC00AC0
+000020 0FC00AC0 0FC00AA8 00444042 00A3AE01 0FC009C8
+000040 0FC00AE0 6E3BFFE0 00000000 00000000 00000000
+000060 0FC00B00 00000000 00000000 00000000 00000000
+000000 0AD963C8 10000000 0AD96188 00000000 00000000
So, A at hex offset 00 has the (expected) hex value 00000000, and B at hex offset 04 has the (also expected) hex value 0000001D or the decimal value 29.