PL/I argument passing considerations

The PL/I OPTIONS option of both the PROCEDURE statement and ENTRY declaration permits you to specify the mutually exclusive options BYVALUE and BYADDR.
OPTIONS(BYVALUE)
Specifies that the PL/I procedure expects arguments to be passed to it by value (direct). OPTIONS(BYVALUE) can be specified for external PROCEDURE statements and ENTRY declarations. It applies to all arguments and argument descriptors.
OPTIONS(BYADDR)
Specifies that the PL/I procedure expects arguments to be passed to it by reference (indirect) or by value (indirect). OPTIONS(BYADDR) can be specified for external PROCEDURE statements and for ENTRY declarations. It applies to all arguments and argument descriptors.
OPTIONS(BYVALUE) cannot be specified for the following constructs:
  • ENTRY statements:
    ENTRY(N) OPTIONS(BYVALUE);                        /* invalid */
  • Declaration of a parameter:
    PROC(ARG1);
    DCL ARG1 FIXED BIN(31) BYVALUE;                   /* invalid */
  • Parameter descriptor in an ENTRY declaration:
    DCL T ENTRY(FIXED BIN(31) BYVALUE) EXTERNAL;      /* invalid */

All parameters, parameter descriptors, or return values must be specified with either the POINTER or FIXED BIN(31) data type. Return values are passed back in register 15.

OPTIONS(BYADDR) is the default unless the external procedure specifies OPTIONS(MAIN) and is compiled with the SYSTEM(CICS®) or SYSTEM(IMS™) compiler option. In this case, OPTIONS(BYVALUE) is the default. In general, you should specify OPTIONS(BYVALUE) only for a main procedure with a SYSTEM option of IMS or CICS. If you specify OPTIONS(BYVALUE) for a main procedure with other system options, the parameter list is passed to the main procedure as is.

OPTIONS(BYVALUE) for a main procedure implies OPTIONS(NOEXECOPS).

PL/I does not support calls to routines that modify the body of an indirect argument list built by PL/I compiled code.