SYSTEM

The SYSTEM option specifies the format used to pass parameters to the MAIN PL/I procedure, and generally indicates the host system under which the program runs.

Read syntax diagramSkip visual syntax diagramSYSTEM(MVSCICSIMSOSTSO)

Table 1 shows the type of parameter list you can expect, and how the program runs under the specified host system. It also shows the implied settings of NOEXECOPS. Your MAIN procedure must receive only those types of parameter lists that are indicated as valid in this table. Additional runtime information for the SYSTEM option is provided in the z/OS Language Environment® Programming Guide.

Table 1. SYSTEM option table
SYSTEM option Type of parameter list Program runs as NOEXECOPS implied
SYSTEM(MVS™) Single CHARACTER string or no parameters z/OS® application program NO
Otherwise, arbitrary parameter list YES
SYSTEM(CICS®) Pointer(s) CICS transaction YES
SYSTEM(IMS) Pointer(s) IMS application program YES
SYSTEM(OS) z/OS UNIX parameter list z/OS UNIX application program YES
SYSTEM(TSO) Pointer to CPPL1 TSO command processor YES
Note:
  1. See Invoking MAIN under TSO/E for more details about how to invoke a MAIN procedure under TSO.

Under SYSTEM(IMS), all pointers are presumed to be passed by value (BYVALUE), but under SYSTEM(MVS) they are presumed to be passed by address (BYADDR).

MAIN procedures run under CICS must be compiled with SYSTEM(CICS) or SYSTEM(MVS).

It is highly recommended that NOEXECOPS be specified in the MAIN procedure OPTIONS option for code, such as a DB2® stored procedure, compiled with SYSTEM(MVS) but run where runtime options would not be passed.

The compiler will flag any MAIN program compiled with SYSTEM(MVS) if it has either more than one parameter or a single parameter that is not CHARACTER VARYING. It is probably better to compile such MAIN programs with SYSTEM(OS) because the library then simply passes on to MAIN the parameter list without any scanning for options or other massaging of the parameter list.