Descriptions of Directives (cont.) [ Micro Focus COBOL System Reference, Volume 2 ] MPE/iX 5.0 Documentation
Micro Focus COBOL System Reference, Volume 2
Descriptions of Directives (cont.)
OPT
Specifies the level of optimization of the code produced in the .obj
file.
Syntax:.
Parameters:.
integer 0, 1, or 2.
Default:.
OPT"2"
Phase:.
Generate
Environment:.
16-bit
$SET:.
Any
Dependencies:.
If OPT"0", set to OPT"1" at end by EANIM, GANIM or OMF"GNT". OPT"0" sets
NOOBJLITE and NODATALIT at end.
Remarks:.
The possible values of integer are:
0 Intermediate code as produced by the first pass of the Compiler.
This is generally smaller than native code, but is slower for
processor-bound operations. Programs compiled with OPT"0" cannot
be linked with the static linked run-time system, LCOBOL.
1 Standard generated native code.
2 Optimized generated code. Optimization does not change the logic
of your program, but there might be incidental effects because some
statements might have no associated machine code and statement
order is not preserved. For example, PERFORM n TIMES of an empty
paragraph causes no code to be generated, so this construct cannot
be used to form a delay loop.
OPTIONAL-FILE
Makes the Compiler treat all files opened for I-O or EXTEND as optional.
Syntax:.
Parameters:.
None
Default:.
OPTIONAL-FILE
Phase:.
Syntax check
Environment:.
All
$SET:.
Initial
Dependencies:.
Set to OPTIONAL-FILE immediately by NORM. Set to NOOPTIONAL-FILE
immediately by RM or RM"ANSI".
Remarks:.
Under ANSI'85 Standard COBOL, a file is treated as optional only if it
has the OPTIONAL phrase in its SELECT statement. For compatibility with
the ANSI'85 Standard you must specify the NOOPTIONAL-FILE directive.
OPTSIZE
Makes the Compiler treat the size of the object program as a higher
priority than its speed, within the constraints imposed by other
directives.
Syntax:.
Parameters:.
None
Default:.
OPTSIZE
Phase:.
Generate
Environment:.
16-bit
$SET:.
Initial
Remarks:.
The directives OPTSPEED and OPTSIZE are alternates. Hence, if you don't
want OPTSIZE specify OPTSPEED.
OPTSPEED
Makes the Compiler treat the speed of the object program as a higher
priority than its size, within the constraints imposed by other
directives.
Syntax:.
Parameters:.
None
Default:.
OPTSIZE
Phase:.
Generate
Environment:.
16-bit
$SET:.
Initial
Remarks:.
The directives OPTSPEED and OPTSIZE are alternates. Hence, if you don't
want OPTSPEED specify OPTSIZE.
Other directives such as TRUNC also affect the speed of the program.
OSEXT
Tells the Compiler what extension to expect by default on the names of
source files.
Syntax:.
Parameters:.
ext The extension.
Default:.
OSEXT"cbl"
Phase:.
Syntax check
Environment:.
All
$SET:.
Any
Remarks:.
The extension is added if the source file-name used in the command or
prompt does not have an extension or a trailing period. This happens
only if the directive is specified in cobol.dir.
It is also used if you specify a source file-name with no extension or
trailing period in a COPY statement. The Compiler searches first for the
file with the name given by adding the extension specified in this
directive. If none is found, it adds the extension .cpy and looks again.
If that is not found it searches for the file with no extension.
See also:.
COPYEXT
OSVS
Specifies that words reserved in IBM OS/VS COBOL are to be treated as
reserved words.
Syntax:.
Parameters:.
None
Default:.
NOOSVS
Phase:.
Syntax check
Environment:.
All
$SET:.
Initial
Dependencies:.
OSVS sets NODOSVS immediately
See also:.
DOSVS
OVERRIDE
Replaces a reserved word by a new one.
Syntax:.
On DOS, Windows and OS/2:
On UNIX:
Parameters:.
rsv-word Existing reserved word.
user-word Any COBOL word not the same as an existing reserved
word.
Default:.
No change of reserved words takes place.
Phase:.
Syntax check
Environment:.
All
$SET:.
Initial
Remarks:.
This directive equates an existing reserved word to the specified
user-defined word, so that, in the program, user-word is treated as a
reserved word, and rsv-word is treated as a user-defined word.
The equals signs must be surrounded by spaces. If the parameters are
repeated they must be separated by spaces.
This directive does not appear in the list created with the SETTING
directive.
PANVALET
Allows ++INCLUDE statements in your program.
Syntax:.
Parameters:.
None
Default:.
NOPANVALET
Phase:.
Syntax check
Environment:.
All
$SET:.
Any
Remarks:.
The ++INCLUDE statement specifies a file for inclusion in the source
program. The string ++INCLUDE must be written as a contiguous sequence
of characters starting in area-A or area-B, followed by one or more
spaces, and then, on the same line, by the name of a file containing
COBOL source. This file is included in the program at the point where
the ++INCLUDE statement appears.
If you specify PANVALET and LIBRARIAN together, a warning message
is given advising that the compiled program might not be
mainframe-compatible.
PARAMCOUNTCHECK
Allows the program to be called with fewer parameters than are specified
in the relevant entry-point's USING clause.
Syntax:.
Parameters:.
None
Default:.
NOPARAMCOUNTCHECK (with OMF"OBJ") PARAMCOUNTCHECK (with OMF"GNT")
Phase:.
Generate
Environment:.
16-bit
$SET:.
Initial
Remarks:.
You must use this directive if one of the following applies:
* The program is called with a variable number of parameters
* The program contains a Linkage Section, and is to be used both as
a main program run from the command line and as a subprogram
called from another program
* The program calls any program compiled with STICKY-LINKAGE"2"
specified
Otherwise the program can be compiled with NOPARAMCOUNTCHECK for
efficiency. A program to be called from a language other than COBOL must
be compiled with NOPARAMCOUNTCHECK.
Unless you specify the LINKCHECK directive, attempting to reference a
Linkage Section item that does not exist might result in a system hang on
DOS, or a protection violation on OS/2.
See also:.
LINKCHECK, STICKY-LINKAGE
PARAS
Creates a list of paragraphs and sections in a program.
Syntax:.
Parameters:.
None
Default:.
NOPARAS
Phase:.
Generate
Environment:.
16-bit
$SET:.
Initial
Remarks:.
Specifying PARAS causes the generated code addresses of all paragraphs
and sections to be produced. This list is placed in the listing file
specified by the ASMLIST directive. The assembler listing that is
normally in this file is suppressed if PARAS is specified.
The ANIM directive must also be specified for the PARAS directive to
work.
See also:.
ASMLIST, ANIM
PC1
Specifies that words reserved in IBM COBOL 1.00 are to be regarded as
reserved words, and changes the behavior of certain features to be
compatible with that product.
Syntax:.
Parameters:.
None
Default:.
NOPC1
Phase:.
Syntax check
Environment:.
All
$SET:.
Initial
Dependencies:.
PC1 sets DEFAULTBYTE"0" and ACCEPTFRESH immediately.
Remarks:.
This directive is synonymous with the IBM-MS and MS"1" directives.
PERFORM-TYPE
Specifies the behavior of return jumps from nested PERFORM statements.
Syntax:.
Parameters:.
dialect MF, OSVS, or RM.
Default:.
PERFORM-TYPE"MF"
Phase:.
Syntax check
Environment:.
All
$SET:.
Initial
Dependencies:.
PERFORM-TYPE"OSVS" sets TRICKLE at end
Remarks:.
The possible values of dialect are:
MF Only the exit point of the innermost PERFORM currently
being executed is recognized and its return jump taken.
OSVS The exit point of any PERFORM statement currently being
executed is recognized if reached; the return jump taken is
the first reached. PERFORM statements with the same exit
point can be nested to a depth of two (one inner and one
outer). If they are nested deeper, they do not return
correctly. The end of a section is regarded as the same
point as the end of its last paragraph.
PERFORM-TYPE"OSVS" provides compatibility with the
mainframe behavior of OS/VS COBOL, DOS/VS COBOL, VS COBOL
II and COBOL/370.
RM The exit point of any PERFORM statement currently being
executed is recognized if reached; the return jump taken is
the first reached. PERFORM statements with the same exit
point cannot be nested; if they are they do not return
correctly. The end of a section is regarded as a separate
point from the end of its last paragraph.
See also:.
STICKY-PERFORM
PREPLIST
Causes the list file produced during a compilation to show both the
original and modified source created by the preprocessor as well as to
show all data passed to the Compiler by a preprocessor.
Syntax:.
Parameters:.
None
Default:.
NOPREPLIST
Phase:.
Syntax check
Environment:.
All
$SET:.
No
Remarks:.
This directive is provided as a debugging aid to preprocessor writers.
PREPROCESS
Makes the Compiler take the source program from a preprocessor instead of
a source file.
Syntax:.
Parameters:.
nam The preprocessor to use.
dir Directives to be passed directly to the preprocessor.
Default:.
NOPREPROCESS
Phase:.
Syntax check
Environment:.
All
$SET:.
On very first source line only No (with NOPREPROCESS)
Remarks:.
This directive informs the Compiler that an integrated preprocessor is to
be used. See the chapter Integrated Preprocessor for details of its use.
PRINT
Specifies the destination of the source listing file.
Syntax:.
Parameters:.
destination A full file specification, or a device-name.
Default:.
NOPRINT
Phase:.
Syntax check
Environment:.
All
$SET:.
Any
Remarks:.
PRINT is synonymous with LIST. All rules that apply to LIST also apply to
PRINT.
See also:.
LIST
PRINT-EXT
Specifies the extension to be added to the file-name associated with the
ASSIGN TO PRINTER clause.
Syntax:.
Parameters:.
extension The extension to be added.
Default:.
No extension is added
Phase:.
Syntax check
Environment:.
All
$SET:.
Any
Remarks:.
This directive is ignored unless ASSIGN-PRINTER() is specified with no
file-name.
See also:.
ASSIGN-PRINTER
PROFILE
Includes code in your program to produce detailed performance statistics
each time you run the program.
Syntax:.
Parameters:.
None
Default:.
NOPROFILE
Phase:.
Syntax check
Environment:.
UNIX
$SET:.
No
PROGID-COMMENT
Allows comments following the Program-ID in the Program-ID paragraph.
Syntax:.
Parameters:.
None
Default:.
NOPROGID-COMMENT
Phase:.
Syntax check
Environment:.
All
$SET:.
Initial
Remarks:.
This directive is provided for compatibility with earlier versions of
this product.
PROTECT-LINKAGE
Enables a subprogram to read a larger area of data than is actually
passed in the Linkage Section, without causing a protection violation.
Syntax:.
Parameters:.
None
Default:.
NOPROTECT-LINKAGE
Phase:.
Syntax check
Environment:.
All
$SET:.
Initial
Remarks:.
This directive is used when the subprogram is compiled. It causes code
to be inserted whenever an alphanumeric linkage item is referenced as a
sending item. This code ensures that the operation succeeds, even if
there is less data actually available than that referenced by the linkage
item.
Example:.
Calling program:
...
03 x1 pic x.
03 x2 pic x(100).
procedure division.
...
call subprog using x1
...
Subprogram:
$set protect-linkage working-storage section.
01 y1 pic x(1000).
linkage section.
01 z1 pic x(1000).
procedure division using z1.
move z1 to y1
* This operation works, and transfers the contents of x1. It also
* transfers any data following x1 in the calling program, up to
* 1000 bytes or the end of allocated memory, whichever occurs
* first. If less than 1000 bytes is transferred, the remainder
* of y1 is space filled.
move y1 to z1
* This operation is not protected and fails, either by corrupting
* data beyond x1 in the calling program, or attempting to write
* beyond allocated memory, which results in a protection
* violation.
MPE/iX 5.0 Documentation