Run-Time Switches [ Micro Focus COBOL System Reference, Volume 2 ] MPE/iX 5.0 Documentation
Micro Focus COBOL System Reference, Volume 2
Run-Time Switches
Run-time switchesaffect optional aspects of the behavior of certain COBOL
features at run time or set certain variable quantities used by the
run-time system. The following sections detail the run-time switches
available.
A - Animator Switch
Invokes Animator to animate intermediate code which is either created
using the cobrun command or dynamically loaded by a statically linked
module.
Default:.
Off
Environment:.
32-bit run-time systems
Remarks:.
If you wish to animate intermediate code created by the cob command, you
can use the anim command which automatically sets this switch on.
This switch overrides the A1 switch.
A1 - Base Animator Switch
Invokes Base Animator to animate intermediate code which is either
created using the cobrun command or dynamically loaded by a statically
linked module.
Default:.
Off
Environment:.
32-bit run-time systems
Remarks:.
If you wish to animate intermediate code created by the cob command, you
can use the anim command which automatically sets this switch on.
This switch overrides the A switch.
B - Skip Locked Record Switch
Causes the record pointer to be updated past any locked record
encountered when using the READ NEXT statement.
Default:.
Off
Environment:.
All
Remarks:.
Set the B switch for indexed sequential files open INPUT or I-O. This
permits a file to be sequentially read, even if another process has
records locked within that file.
A file status of "locked record" is returned when a locked record is read
when the B switch is set.
D - Standard ANSI COBOL Debug Switch
Invokes the standard ANSI COBOL Debug module.
Default:.
Off
Environment:.
All. Set on command line.
Remarks:.
See your Language Reference - Additional Topics for a description of the
Debug facilities.
Example:.
The command:
cobrun +D myprog.int
loads the program myprog with the standard ANSI COBOL Debug module
invoked.
d - Dynamic Paging Buffer Switch
Specifies the amount of memory in bytes to be used for the run-time
system dynamic paging buffers.
Default:.
d250000 (250 Kbytes)
Environment:.
32-bit run-time systems
Remarks:.
Dynamic paging is used by programs such as the Compiler and the
Generator. By increasing the amount of memory you may be able to improve
the performance of such programs. Once the amount of memory allocated
for dynamic paging is exceeded, the run-time system pages any further
requirements onto disk.
For example, when compiling a large COBOL program, the amount of memory
for dynamic paging buffers might be exceeded due to the Compiler
requiring a large amount of dictionary to store the symbol table it
creates. When the dynamic paging buffer space is exhausted, the run-time
system starts to page dynamic accesses to disk, which may have a
performance overhead. By raising the amount of memory for dynamic
buffering, paging to disk may be avoided (or at least reduced) and
therefore better Compiler performance achieved.
Example:.
To double the amount of memory (to 500 Kbytes) the run-time system could
use before paging to disk, you would set the COBSW environment variable
as follows:
COBSW=-d500000
E - Error Switch
Executes intermediate code which contains S-level syntax-check errors.
Default:.
Off
Environment:.
All
Remarks:.
If you try to run intermediate code programs which contain S-level
compiler errors when this switch is set to off, you receive a run-time
error. See your Error Messages manual for full details of these errors.
e - COBOL Symbol Switch
Causes the run-time system to search for COBOL or C programs or symbols
to satisfy call operations or external data items.
Default:.
On
Environment:.
32-bit run-time systems
Remarks:.
The run-time system will not search for any C programs or symbols if you
set this switch off.
F - Numeric Field Check Switch
Checks all numeric items for valid numeric data when processing
intermediate code. Also checks for valid data when alphanumeric or
edited-numeric data items are moved to numeric data items.
Default:.
On
Environment:.
All
Remarks:.
If the data is not valid, run-time error 163 (Illegal character in
numeric field (fatal)) is produced. Setting this switch to off
suppresses this checking.
If this switch is off and incompatible data is referenced by the program,
it may behave normally or it might give unexpected results.
The run-time system and generated code attempt to optimize many types of
numeric operations. These operations may cause invalid results if the
numeric operands do not contain valid numeric data, such as nonnumeric
data in numeric fields. By default, the run-time system gives the
run-time system error 163 when a numeric operation is attempted with
invalid numeric data.
We recommend that you adjust your code so that no invalid data is used.
If this is not possible, you can use the Compiler directive SPZERO to
disable these numeric optimizations.
Example:.
One of the checks enabled or disabled by this switch is the numeric field
check. When this switch is set on, if the run-time system loads an item
into one of its numeric registers it first checks whether the loaded
value contains a nonnumeric character. If this is the case, run-time
error 163 is output. For example:
working-storage section.
01 item-a pic 9.
procedure division.
if item-a = 0
display "zero"
else
display "non-zero"
end-if.
The variable item-a is not initialized by a VALUE clause, and so contains
a space character x"20". Running this program with the F switch set on
causes the run-time system to check that the numeric field does not
contain a nonnumeric value, resulting in run-time error 163.
The following table summarizes typical results of running the
intermediate and generated code versions of the above program with the
alternative settings of the F switch:
-F +F
--------------------------------------------
.int Displays "zero" Run-time error 163
.gnt Displays Displays
"non-zero" "non-zero"
The following table summarizes the results of running the intermediate
and generated code versions of the above program with the alternative
settings of the F switch, if the native code generator option SPZERO was
set:
-F +F
--------------------------------------------
.int Displays "zero" Run-time error 163
.gnt Displays "zero" Displays "zero"
i - Keyboard Interrupt Switch
Enables keyboard interrupts. If your system supports Job Control, this
switch also enables the Suspend Interrupt key (usually Ctrl+Z).
Default:.
On
Environment:.
32-bit run-time systems
K - Indexed Files Sequence Check Switch
Enables sequence-checking of keys in indexed files.
Default:.
Off
Environment:.
32-bit run-time systems
Remarks:.
Setting the K switch to on enables records to be written in any order to
indexed files opened in sequential mode. Otherwise records must be
written in key sequence.
l (lower-case L) - Memory Switch
Enables you to set the amount of available memory.
Default:.
linteger
where integer is the maximum number of bytes available to the run-time
system.
Environment:.
32-bit run-time systems
Remarks:.
By default the run-time system performs logical cancels unless all
available memory has been used up. As far as your programs are
concerned, the behavior of logical and real cancels is identical, but
logical cancels are faster. A logical cancel flushes all file buffers
but does not release any memory. To force all cancels to be real you
must specify this switch with parameter zero; for example:
+l0
By default, when the run-time system requires memory space it checks that
the new request does not exceed the available memory. If it does, the
memory that should have been freed by any cancels is freed and the
run-time system repeats its request for memory. The run-time system
loads programs that have been logically canceled in preference to
reloading from disk.
Note that this switch is lower-case L and not upper-case I.
N - Null Switch
Enables null insertion for all line sequential files in your program.
Default:.
On
Environment:.
All
Remarks:.
This switch is especially useful if the format of your files is
incompatible with this version of COBOL.
Setting this switch to on means that when a program writes records to a
line sequential file with a record containing control characters (that
is, all characters with ASCII codes less than or equal to x"1F"), the
system adds a null character (x"00") before each control character.
Similarly, on reading a record from a line sequential file, these null
characters are stripped from the control characters.
Setting this switch affects only the physical storage of data in a line
sequential file. Records written with one setting and read back with the
same setting are returned in exactly the same way. However, you should
note that if you attempt to input a file with one setting that had been
output with the other setting, the results are unpredictable.
Setting this switch off enables control characters to be written and read
in the same way as other characters.
When the N switch is on:
* Any character is allowed in the data record of a line sequential
file.
* Each record is examined before it is written. All characters
whose value is less than x"1F" are written with a preceding null
(x"00") to form 2-byte pairs. On output to disk, trailing spaces
are removed, and a record terminator of x"0D0A" is appended to
terminate the record.
* The file is read as records, some of which might contain 2-byte
pairs where the first byte is null. The records are terminated by
a record terminator. The leading null of each 2-byte pair is
removed to give the final data record. Tabs (x"09") that do not
form part of a 2-byte pair are expanded.
NOTE Control characters depend on the operating system. Their
hexadecimal values are always less than x"1F". CR (x"0D"), LF
(x"0A"), TAB (x"09"), NUL (x"00"), and EOF (x"1A") are all
recognized control characters on DOS and OS/2.
When the N switch is off:
* Data records in a line sequential file must contain only ASCII
text characters (those with a value greater than x"1F").
* Trailing spaces are removed on output to disk, and a record
terminator of x"0D0A" is appended to terminate the record.
Printer control characters might also be written to disk.
* The file is read as data records with each record terminated by a
record terminator. If the data contains either x"0D" or x"0A",
results can be unpredictable. Tab characters (x"09") are expanded
to spaces; otherwise the data record is returned intact.
Example:.
The command:
cobrun -N myprog
loads the program myprog and specifies that, in line sequential files,
all characters less than x"1F" except for TAB and the file control
characters are treated as data. Null is not inserted before data
characters less than x"1F" on output.
O - Divide-by-Zero Switch
Disables run-time error 48 (Attempt to divide by zero), causing the
program to continue with undefined results.
Default:.
On
Environment:.
All run-time systems
Remarks:.
A program compiled with CHECKDIV"OSVS", CHECKDIV"VSC2" or
CHECKDIV"COBOL370" set produces run-time error 48 upon an attempt to
divide by zero. Setting this switch off (-O) disables this error,
causing the program to continue with undefined results. This switch has
no effect on programs that were not compiled using one of the above
directive settings.
p - Dynamic Linkage Fixup Switch
Causes the run-time system to set the addressability for all Linkage
Section items in a program when it is called.
Default:.
On
Environment:.
32-bit run-time systems
Remarks:.
Setting this switch to off causes the run-time system to set up COBOL
parameters (that is, Linkage Section items) on demand. By default, the
run-time system sets up the addressability for all the Linkage Section
items in a program when it is called.
Setting this switch to off can improve the run-time performance of
subprograms with large linkage areas. This is because the linkage fixup
is performed the first time an item is accessed, so if an item is not
accessed no fixup is performed for it.
Q - File Status Error Switch
Maps extended file status codes (9/nnn) to a status that conform to the
statuses returned in the COBOL dialect of your choice.
Default:.
Off
Environment:.
32-bit run-time systems
Remarks:.
Setting this switch on causes all extended file status codes to be
mapped, using an internal run-time system table, to a status that
conforms to the statuses returned in the COBOL dialect of your choice.
See the chapter File Status in your COBOL System Reference for details of
how to configure the COBOL dialect you wish to use. See your Language
Reference for full details on file status errors.
S - Sort Switch
Causes duplicates in all SORT operations to be ordered. This switch has
the same effect on MERGE operations, although the WITH DUPLICATES IN
ORDER phrase is valid syntax only for SORT statements.
Default:.
Off
Environment:.
32-bit run-time systems
Remarks:.
Setting this switch is the only available method of ensuring that all
duplicates in a SORT operation are in order. Although you can explicitly
specify the WITH DUPLICATES IN ORDER phrase in your source code it has no
effect at run time.
The SORT puts temporary work files in the directory specified by the
system defined "tmpdir" environment variable. If tmpdir is not set, the
system default temporary directory will be used instead (as defined by
the value of "P_tmpdir" in stdio.h).
s - Sort Memory Switch
Specifies the amount of memory used as an internal workspace when
performing a SORT operation.
Default:.
Off
Environment:.
32-bit run-time systems
Remarks:.
Setting this switch specifies the amount of memory used in bytes. Note
that this switch can make your appliaction run more slowly.
T - Tab Switch
Enables insertion of tab characters in all line sequential files.
Default:.
Off
Environment:.
All
Remarks:.
This switch is especially useful if the format of your files is
incompatible with this version of the COBOL System.
On output to disk, multiple spaces before a tab stop position are written
as one tab character. The T switch does not affect any trailing spaces
as these are not part of the line sequential record, and they are removed
on output. Tab positions are every eight character positions (for
example, 9, 17, 25 and so on) and cannot be changed.
On input, tab characters are always expanded to spaces to the next
position, regardless of the setting of the T switch.
When this switch set to off, all spaces in a line sequential file are
written to disk as space characters.
MPE/iX 5.0 Documentation