C PLIST and EXECOPS interactions

You can use C #pragma runopts to specify to the C compiler a list of options to be used at run time. Two of the options of #pragma runopts affect the format of the argument list passed to the application on initialization: EXECOPS and PLIST.

EXECOPS allows you to specify runtime options on the command line or in JCL at application invocation. NOEXECOPS indicates that runtime options cannot be so specified. When the EXECOPS runtime option is specified under MVS™, Language Environment alters the MVS parameter list format: Language Environment removes any runtime options that are present.

PLIST indicates in what form the invoked routine should expect the argument list. You can specify PLIST with the following values under Language Environment:
HOST
The argument list is assumed to be a character string. The string is located differently under various systems as follows:
  • Under TSO, if a CPPL is detected, Language Environment gets the string from the command buffer.
  • Under TSO, if a CPPL is not detected, Language Environment assumes a halfword-prefixed string in the MVS format.
  • Under MVS, Language Environment uses the halfword-prefixed string.
OS
The inbound parameter list is assumed to be in an MVS linkage format in which register 1 points to a parameter address list. No runtime options are available. Register 1 is not interrogated by Language Environment.

The PLIST(HOST) setting allows the object to execute under MVS (assuming a halfword-prefixed string), or under TSO (using the CPPL or the MVS-format parameter list). Specify PLIST(HOST) to default to the argument list format for the operating system under which your application is running.

Although Language Environment supports the MVS, IMS™, and TSO suboptions of PLIST for compatibility, use of PLIST(HOST) is recommended. There are some exceptions to this guideline:
Preinitialization
PLIST(MVS) is supported for compatibility with pre-Language Environment C preinitialization programs.
CICS®
If you are running a CICS application compiled under the pre-Language Environment-conforming version of C, PLIST(HOST), the default, is assumed regardless of the actual PLIST setting. If you are running a CICS application compiled with a Language Environment-conforming C compiler, specify PLIST(OS).
TSO
TSO command processors that require access to the full CPPL must specify PLIST(OS).
The EXECOPS, NOEXECOPS, and PLIST options can alter the format of the argument list passed to your application, depending on the combination of options specified. The setting of EXECOPS determines whether Language Environment looks for runtime parameters in the inbound parameter list. The effects of the interactions of these options under the various operating systems and subsystems are summarized in Table 1:
Table 1. Interactions of C PLIST and EXECOPS
Operating system Method of invocation PLIST suboption EXCECOPS (default) arg/argv __R1/__osplist and PCBs
MVS EXEC PGM=,

PARM= <runtime options> / <user args>

HOST Yes. <runtime options> honored argc = number of tokenized args in <user args>

argv[0…argc-1] = tokenized args in <user args>

 
MVS EXEC PGM=,

PARM= <runtime options> / <user args>

HOST No. <runtime options> ignored argc = number of tokenized args in the entire PARM string, that is, <runtime options> / <user args>

argv[0…argc-1] = tokenized args in the entire PARM string

 
MVS Assembler calls C module with pre-Language Environment preinitialization PLIST with runtime options specified in the PLIST MVS Yes. <runtime options> honored argc/argv = <argc,argv> structure specified in the preinitialization PLIST  
MVS Assembler calls C module with pre-Language Environment preinitialization PLIST with runtime options specified in the PLIST MVS No. <runtime options> ignored argc/argv = <argc,argv> structure specified in the preinitialization PLIST  
MVS Driver link to C main passing noncharacter parameter list OS n/a argc=1

argv[0] = name of C main program module

Access register 1 through __osplist macro as defined in stdlib.h
TSO CALL, LOADGO, execute module on TSO command line passing <runtime options> / <user args> HOST Yes. <runtime options> honored argc = number of tokenized args in <user args>

argv[0…argc-1] = tokenized args in <user args>

 
TSO CALL, LOADGO, execute module on TSO command line passing <runtime options> / <user args> HOST No. <runtime options> ignored argc = number of tokenized args in <runtime options> / <user args>

argv[0…argc-1] = tokenized args in <user args>

 
TSO CALL OS n/a argc=1

argv[0] = name of module

Access CPPL through __osplist as defined in stdlib.h
IMS Invoke C main module OS or IMS

Specify ENV(IMS) also.

n/a argc=1

Start of changeargv[0] = name of C main module or null if the #pragma runopts(PLIST(IMS)) is present in the sourceEnd of change

Access PCBs through C macros as defined in ims.h
CICS Invoke C main module n/a n/a argc=1

argv[0] = transaction id