WRITABLE

The WRITABLE option specifies that the compiler can treat static storage as writable (and if it does, this will make the resultant code nonreentrant).

This option has no effect on programs compiled with the RENT option.

Note: The WRITABLE option is ignored under the LP(64) option.
Read syntax diagramSkip visual syntax diagram
   .-WRITABLE----------------------.   
>>-+-NOWRITABLE--+---------------+-+---------------------------><
                 |    .-FWS .    |     
                 '-(--+-PRV-+--)-'     

The NORENT WRITABLE options allow the compiler to write on static storage to implement the following constants or variables:

Under the NORENT WRITABLE options, a module using CONTROLLED variables, performing I/O, or using FETCH is not reentrant.

The NORENT NOWRITABLE options require the compiler not to write on static storage for the following constants or variables:

Under the NORENT NOWRITABLE options, a module using CONTROLLED variables, performing I/O, or using FETCH is reentrant.

The FWS and PRV suboptions determine how the compiler handles CONTROLLED variables:

FWS
Upon entry to an EXTERNAL procedure, the compiler makes a library call to find storage it can use to address the CONTROLLED variables in that procedure (and any subprocedures).
PRV
The compiler will use the same pseudoregister variable mechanism used by the old OS PL/I compiler to address CONTROLLED variables.

Hence, under the NORENT NOWRITABLE(PRV) options, old and new code can share CONTROLLED variables.

However, this also means that under the NORENT NOWRITABLE(PRV) options, the use of CONTROLLED variables is subject to all the same restrictions as under the old compiler.

Under the NORENT NOWRITABLE(FWS) options, the following application might not perform as well as if they were compiled with the RENT or WRITABLE options:

The performance of an application under NORENT NOWRITABLE(FWS) might be especially bad if it uses many CONTROLLED variables in many PROCEDUREs.

Under the NOWRITABLE option, the following variables and constants cannot be declared in a PACKAGE outside a PROCEDURE:

Code compiled with NORENT WRITABLE cannot be mixed with code compiled with NORENT NOWRITABLE if they share any external CONTROLLED variables. In general, you should avoid mixing code compiled with WRITABLE with code compiled with NOWRITABLE.