Considerations for coding and link-editing the routine
Certain considerations apply when you code and link-edit the routine.
You must consider the following items when you link-edit the routine:
- The routine must be link-edited with the REUSE option.
- The routine must be link-edited in 31-bit addressing mode (AMODE
The reason is that database buffer pools are allocated above the 16-MB line and the address of the segment prefix is set into a parameter list as a 31-bit address. The HDMB and HRAN control blocks are also above the 16-MB line.Note: If the routine does not refer to the address of any segment prefix, HDMBs, or HRANs, it can be link-edited as AMODE 24. But the 31-bit addressing mode is recommended, to avoid the addressing mode problems.
If the routine is link-edited in 31-bit addressing mode, but performs functions requiring AMODE 24, you must code the residency mode (RMODE) as needed. Before running the function, you must use the capping method to dynamically change the addressing mode to AMODE=24; after the function has run you must return to AMODE 31. The following figure shows a sample code for such capping: