Setting the Address of Linkage Section Items
- The calling program uses the CALL USING statement to pass operands to the called program, and
- The called program specifies the USING phrase in the Procedure Division header.
For each operand that is listed on the CALL USING statement in the calling ILE program, there must be a corresponding operand that is specified by the USING phrase in the Procedure Division of the called program.
When using the ADDRESS OF special register, you no longer need to ensure a one-to-one mapping between the USING phrases of the two programs. For those data items in the Linkage Section that are not specified in the USING phrase of the Procedure Division header, you can use a SET statement to specify the starting address of the data structure. Once the SET statement is run, the data item can be freely referred to since the address of the data item is already set. For an example of a SET statement used in this manner, refer to Figure 2. In Figure 2, 15 and 16 illustrates how the SET statement is used to set the starting address of the data structures ls-header-record and ls-user-space at the beginning of the user space.