Defining a compiler-option data set (SYSOPTF)

Define a data set that contains the compiler options for your COBOL program by coding the SYSOPTF DD statement as shown below.

About this task


//SYSOPTF  DD  DSNAME=dsname,UNIT=SYSDA,VOLUME=(subparms),DISP=SHR

To use a compiler-option data set, specify OPTFILE either as a compiler invocation option or in a PROCESS or CBL statement in your source program.

Within the SYSOPTF data set:
  • Specify compiler options in free form between columns 2 and 72, using the same syntax as you use for invocation options or for compiler options in a PROCESS or CBL statement.
  • Code an asterisk (*) in column 1 to cause a line to be treated as a comment.
  • Optionally code sequence numbers in columns 73 through 80; those columns are ignored.

You can optionally place the compiler options directly in the input stream after the SYSOPTF DD statement if you compile using the OPTFILE option:


//COB      EXEC PGM=IGYCRCTL,PARM='OPTFILE' 
//SYSOPTF  DD DATA,DLM=@@ 
 SSRANGE   ARITH(COMPAT)
 OPTIMIZE 
 . . .
@@ 
//SYSIN    DD . . . 

You can concatenate multiple SYSOPTF DD statements if you have multiple compiler-option data sets:


//SYSOPTF  DD  DSNAME=dsname1, . . .
//         DD  DSNAME=dsname2, . . .

Compiler options that are in later data sets in the concatenation take precedence over options in earlier data sets in the concatenation.