LSACHECK
Use the LSACHECK option (LSACHECK is short for Linkage Section Addressability Check) to prevent inadvertent use of LINKAGE-SECTION data items prior to establishing addressability.
The LSACHECK compiler option tells the compiler to generate code to initialize BLL cells
(addresses for LINKAGE-SECTION data items) to x'7FFF000'
instead of the previous
default of x'00000000'
. With NOLSACHECK the BLL cells will still be initialized to
x'00000000'
.
This particular address is for a page in the z/OS system that has no storage backing it, so that any references to this page will result in an 0C4 ABEND. Using LSACHECK would result in 0C4 ABENDs for any references data items whose addresses have not been set explicitly in program or via input parameters.
Default is: NOLSACHECK
Abbreviations are: LSAC | NOLSAC
LINKAGE SECTION.
01 LINKAGE-ITEM PIC C(100).
PROCEDURE DIVISION. *> LINKAGE-ITEM will not get any
*> address from a CALLing program
LINKAGE SECTION.
01 LINKAGE-ITEM PIC C(100).
PROCEDURE DIVISION USING LINKAGE-ITEM. *> LINKAGE-ITEM will
*> get the address from the USING
*> phrase of the CALL statement
*> of the CALLing program
*> NOTE: If a program is called with no USING phrase, the
*> address will be changed and will not have the LSACHECK value.
*> Our testing showed a different ABEND from the LSACHECK
*> ABEND.
*> In the following example, the BLL for LINKAGE-ITEM will
*> be set to the value in Pointer-1
SET ADDRESS OF LINKAGE-ITEM To Pointer-1
*> In the following example, the BLL for LINKAGE-ITEM will
*> be set to the address of Working-Storage-Item
SET ADDRESS OF LINKAGE-ITEM To
ADDRESS OF Working-Storage-item
*> In the following example, the BLL for LINKAGE-ITEM will
*> be set to the address of the storage acquired by the
*> ALLOCATE statement
ALLOCATE LINKAGE-ITEM
Performance implications
LSACHECK will not affect the resulting program performance as there is no extra processing for programs that are compiled with LSACHECK.
AMODE 64 implications
x'000000007FFFF000'
to get similar behavior to LP(32) programs with BLLs
set to x'7FFFF000'
.