PreviousRun-time Configuration The COBOL ProfilerNext"

Chapter 13: Descriptions of Run-time Switches

This chapter describes the available programmable and run-time switches. Each entry first describes the effect of the switch when it is set on; unless otherwise specified, the opposite effect can be assumed if the switch is set to off. The default setting that applies if you do not explicitly set any of these switches is also given. Switches can be set either on the command line or in the COBSW environment variable unless otherwise indicated. For further information on setting and testing switches, see the chapter Running. Key

The function of each switch is given, followed by these headings:

Properties:
Default: The default setting of the switch.
Environment: Indicates the run-time systems and the operating system that this switch works with. If no operating system is specified, it works on all operating systems supporting the specified run-time system. 16-bit run-time systems means both the shared and static-linked run-time systems.
Comments: Additional information about the switch.
See Also:

Pointers to further information

13.1 List of Switches

0, 1, 2, ... 8 Programmable switches
A Choose ANSI file handling and status codes (16-bit only)
A Invoke Animator for intermediate code (32-bit and 64-bit systems only)
A1 Display trailing spaces (DOS, Windows and OS/2 only)
A1 Invoke Base Animator for intermediate code (UNIX only)
B, B1 Skip locked record
B2 Choose the sorting algorithm
C Enable screens longer than 25 lines
C1 Nonstandard size screens
C2 Disable COBOL Text Window
C4 Sets screen into 43-line mode
C5 Sets screen into 50-line mode
D Invoke the ANSI COBOL Debug module
d Set memory size for dynamic paging buffer
D1 Control search method for .dll files
D2 Disable DLL-cancel error reporting
E Execute code containing S-level errors
e Search for C as well as COBOL programs
/E Signal-handling stack size
F Validate numeric data in intermediate code
/F Change file open limit
G Reduce the size of I/O buffers
i Enable keyboard interrupts
I1 Change program search order
I2 Redirect RTS errors to STDERR
K Enable sequence checking on indexed write
K1 Use old IBM PC keyboard handling
K2 Use extended IBM PC keyboard handling
K3 Enable Shift+Ctrl+Break behavior
K4 Pause on RTS error
L Make I/O errors return to program
l Specify memory available for application
L1 Enable the exception popup on OS/2
L2 Determine record terminator for line sequential files
L5 Handle LEVEL II COBOL files
L6 Specify subprogram search order
/L Specify number of record locks
M Free up memory on DOS
M2 Disable paging of active programs
/M Change default number of heaps on OS/2
N Insert nulls in line sequential files
O Enable divide-by-zero error
P Use high-level printer I/O
p Fix up all linkage item addresses on entry
P1 Sound system bell using the BIOS
P2 Enable logical cancels
P3 Increase number of programs loadable
/P Specify address of port for security key
Q Map extended file status codes
R Retry locked record until available
S Order duplicates in sort/merge operations
s Specify memory available for sort
S2 Disable video "snow" protection
S3 Enable video "snow" protection
S5 Use ansi.sys-compatible console I/O
S6 Change DISPLAY UPON CRT attribute behavior
/S Change default stack size
T Insert tabs in line sequential files
Z Control conversion of DBCS spaces
/Z Dummy parameter switch

13.2 Descriptions of Switches


Programmable Switches

Sets the corresponding COBOL switch when the program is entered.

Properties:
Default: All off
Environment: All
Comments:

These switches enable the COBOL switches 0-8 that you defined in the Special-Names paragraph of your program (see your Language Reference for details). You can specify these switches in any order, but each individual switch must be preceded by a sign.


A - ANSI File Status Switch

Implements file handling and status codes according to the particular ANSI standard for which your program was compiled.

Properties:
Default: On
Environment: 16-bit run-time systems
Comments:

If your program was compiled with the ANS85 directive, ANSI'85 file status values are returned. If switch A is off, ANSI'74 status values are returned.


A - Animator

Invokes Animator to animate intermediate code which is either invoked using the cobrun command or dynamically loaded by a statically linked module.

Properties:
Default: Off
Environment: 32-bit and 64-bit run-time systems
Comments:

If you want to animate intermediate code created by the cob command, you can use the animcommand which automatically sets this switch on.

This switch overrides the A1 switch.


A1 - Display Trailing Spaces

Disables the display of trailing spaces by causing DISPLAY ... UPON CONSOLE statements to strip off any trailing spaces in the data item being displayed before outputting the data to the screen.

Properties:
Default: On (16-bit)Off (32-bit)
Environment: 16-bit run-time systems and 32-bit on Windows NT and OS/2 V2
Comments:

This switch provides compatibility with earlier COBOL systems from Micro Focus. When this switch is off, the trailing spaces are included in the display, as required by the ANSI COBOL Standard.


A1 - Base Animator

Invokes Base Animator to animate intermediate code which is either created using the cobrun command or dynamically loaded by a statically linked module.

Properties:
Default: Off
Environment: UNIX
Comments:

If you want to animate intermediate code created by the cob command, you can use the animbase command which automatically sets this switch on.

This switch overrides the A switch.


B, B1 - Skip Locked Record

Causes the record pointer to be updated past any locked record encountered when using the READ NEXT statement.

Properties:
Default: Off
Environment: All
Comments:

Set the B switch for indexed sequential files open INPUT or I-O. Set the B1 switch for indexed sequential files open INPUT. Setting either of these switches permits a file to be sequentially read, even if another process has records locked in that file.

A file status of "locked record" is returned when a locked record is read when the B switch is set; a file status of "00" is returned when a locked record is read when the B1 switch is set.


Note: This switch also affects relative and record sequential files when your program is compiled with the CALLFH directive set.


See also:

CALLFH Compiler directive


B2 - Alternative Sorting Mechanism

Changes the sort algorithm used by the run-time system to one which is more suitable for dealing with huge sorts.

Properties:
Default: Off
Environment: 16-bit run-time systems
Comments:

Normally sorts are optimized to make use of all free memory. This is faster for small sorts. However, when performing a sort on data which is many times the size of free memory, this optimization requires that you have free disk space which is at least twice the size of the data records being sorted.

Setting the B2 switch on optimizes disk usage during a sort so that you only require free disk space which is roughly equal to the size of the data being sorted. Moreover, because less paging to disk occurs, it speeds up large sorts.


C - Large Screen

Enables the use of screens longer than the traditional 25 lines.

Properties:
Default: Off
Environment: 16-bit run-time systems
Comments:

This switch is available for use only with the shared run-time system, which by default treats all screens as 25 lines long. The static linked system always handles screens of any length.

The screen width cannot be altered; only screens 80 columns wide are supported.


C1 - Nonstandard Screens

Enables the run-time system to execute with any screen mode or size.

Properties:
Default: Off
Environment: 16-bit run-time systems
Comments:

Most system software (for example Animator) does not function correctly using screens of more or less than 80 columns. Enhanced accept/display operations function with any screen size.


C2 - COBOL Text Window

Disables the creation of a COBOL Text Window for Presentation Manager applications.

Properties:
Default: Off
Environment: 16-bit run-time systems
Comments:

Specifying +C2 disables the creation of a COBOL Text Window for Presentation Manager applications. However, if a run-time system error occurs with this switch set, a Text Window displaying the error message text is created. This provides compatibility with previous releases of this COBOL system.

This switch does not have any effect running under Windows.


C4 - 43-line Mode

Forces the screen in 43-line mode on an EGA or VGA monitor, or with the COBOL Text Window under Windows.

Properties:
Default: Off
Environment: 16-bit shared run-time system and 32-bit for Windows NT and OS/2 V2
Comments:

The original screen mode is restored upon return to the operating system.

If you have set up program items for COBOL components under Windows, setting this switch causes the components to start in 43-line mode.

You must set the +C switch with the +C4 switch.

See also:

C RTS switch


C5 - 50-line Mode

Forces the screen in 50-line mode on an EGA or VGA monitor, or with the COBOL Text Window under Windows.

Properties:

Default: Off
Environment: 16-bit shared run-time system and 32-bit for Windows NT and OS/2 V2
Comments:

The original screen mode is restored upon return to the operating system.

If you have set up program items for COBOL components under Windows, setting this switch causes the components to start in 50-line mode.

You must set the +C switch with the +C5 switch.

See also:

C RTS switch


D - Standard ANSI COBOL Debug

Invokes the standard ANSI COBOL Debug module.

Properties:
Default: Off
Environment: All
Comments:

See your Language Reference - Additional Topics for a description of the Debug facilities. This switch must be set on the command line.

Example:

The command:

DOS, Windows and OS/2: 
myprog (+D)
UNIX: 
cobrun +D myprog

loads the program myprog with the standard ANSI COBOL Debug module invoked.


d - Dynamic Paging Buffer

Specifies the amount of memory in bytes to be used for the run-time system dynamic paging buffers.

Properties:
Default: -d245760 (240 K)
Environment: UNIX
Comments:

Dynamic paging is used by programs such as the Compiler. By increasing the amount of memory you might 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 might have a performance overhead. By raising the amount of memory for dynamic buffering, paging to disk can be avoided (or at least reduced) and therefore better Compiler performance achieved.

Example:

To double the amount of memory (to 500k) the run-time system could use before paging to disk, you would set the COBSW environment variable as follows:

COBSW=-d500000
See Also:

dynamic_dictionary_limit run-time tunable


D1 - DLL Search Compatibility

Provides compatibility with the method of searching for .dll files on OS/2 as used by Micro Focus COBOL systems before V3.1.

Properties:
Default: Off
Environment: 16-bit run-time systems on OS/2
Comments:

When an application causes the run-time system to try to load a .dll program and the file is not specified with a fully qualified pathname, OS/2 tries to locate the program from the given base-name by searching directories specified in LIBPATH. Before COBOL V3.1, the RTS also searched for the file in the directories specified in the COBDIR environment variable.

Specifying +D1 causes the RTS to search for .dll files in the directories specified in the COBDIR environment variable in addition to OS/2 searching in the directories specified in LIBPATH. The effect is exactly the same as in earlier products.


D2 - DLL-Cancel Error Reporting

Disables run-time system error 177 ("Attempt to cancel program failed") when a cancel of a COBOL DLL fails.

Properties:
Default: Off
Environment: 16-bit shared run-time system on OS/2
Comments:

If the run-time system encounters an error when it tries to cancel a COBOL Dynamic Link library (DLL) on OS/2, it issues error 177. Setting this switch causes the RTS to ignore the error and logically cancel the DLL.


E - Error

Executes intermediate code which contains S-level syntax-check errors.

Properties:
Default: Off
Environment: 16-bit shared run-time system, and 32-bit and 64-bit run-time systems
Comments:

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 system error. See your Error Messages for full details of these errors.


e - COBOL Symbol

Causes the run-time system to search for COBOL or C programs or symbols to satisfy call operations or external data items.

Properties:
Default: On
Environment: UNIX
Comments:

The run-time system does not search for any C programs or symbols if you set this switch off.


E - Signal-handling Stack Size

Specifies in bytes the size of the stack to be used to handle signals.

Properties:
Default: /E2560
Environment: 16-bit shared run-time system on OS/2
Comments:

Under normal circumstances you do not need to change the size of the stack used to handle signals. However, if your application does require more stack space than the default for handling signals you can increase its size using this switch.

See also:

/S RTS switch


F - Numeric Field Check

Checks all numeric items for valid numeric data.

Properties:
Default: On
Environment: All
Comments:

If the data is not valid, run-time system error 163 ("Illegal character in numeric field") is produced. Setting this switch to off suppresses this checking.

This checking is only done on generated code created with the CHECKNUM Compiler directive, and on intermediate code. The run-time system and generated code try to optimize many types of numeric operations. These operations can cause invalid results if the numeric operands do not contain valid numeric data. By default, the run-time system gives the run-time system error 163 when a numeric operation is tried with invalid numeric data.

Invalid data is handled differently by intermediate and native code, by this COBOL system on other environments and different versions of this COBOL system. We recommend that you enable numeric field checking while you are developing your program.

If you receive run-time error 163, we recommend that you adjust your code so that no invalid data is used. You can locate the invalid numeric data in your code by setting the +F switch on and then animating your program until run-time system error 163 is detected.

If you are not able to correct your code, you might want to use one or more of the following Compiler directives to resolve invalid data in numeric fields:

Example:

One of the checks enabled or disabled by this switch is the numeric field check. When the switch is set on, if the run-time system loads an item into one of its numeric registers it firswt checks whether the loaded value contains a non-numeric character. If it does, 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 "nonzero"
    end-if.

The variable item-a is not initialiszed 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 whether the numeric field contains a non-numeric value resulting in run-time error 163.

See also:

BADSIGNS Compiler directive
HOSTSIGNS Compiler directive
CHECKNUM Compiler directive
HOST-NUMCOMPARE Compiler directive
HOST-NUMMOVE Compiler directive
SIGNCOMPARE Compiler directive
SPZERO Compiler directive
ZWB Compiler directive


F - Files-open Limit

Specifies the maximum number of files allowed to be open at a time.

Properties:
Default: 100 on DOS and Windows. 255 on OS/2.
Environment: 16-bit shared run-time system
Comments:

You cannot specify a limit lower than 20.

On OS/2, the maximum value you can specify is 65535. If you specify a larger number, a run-time error message is returned.

On DOS and Windows, the maximum value you can specify is 255. If you specify a larger number, 255 is used instead. The value specified by the FILES parameter in your config.sys file is also used to determine the maximum number of open files. The COBOL run-time system uses whichever is the smaller value of FILES or /F. For example, if FILES = 20 and /F is set to 255, then the maximum number of open files allowed is 20. Similarly, if FILES = 255 and /F is set to 20, the maximum number of open files allowed is 20. To be able to open 255 files you would would need to set both FILES and /F to 255.


G - File Buffer Size

Forces all buffers to be 512 bytes.

Properties:
Default: Off
Environment: 16-bit run-time systems
Comments:

Normally, files opened for random access use 512 byte buffers; however, those opened for sequential access use 4K buffers. Setting this switch to on is useful if memory is at a premium, for example during animation; however, this can impact performance.


i - Keyboard Interrupt

Enables keyboard interrupts. If your system supports Job Control, this switch also enables the Suspend Interrupt key (usually Ctrl+Z).

Properties:
Default: On
Environment: UNIX
Comments:

If you want to disable keyboard interrupts, including the suspend key, for your application, use the -i switch.


I1 - Program-file Search Order

Changes the order in which the run-time system searches for program files.

Properties:
Default: Off
Environment: All
Comments:

Normally, the run-time system searches for program files in the order:

.gnt
.int
.lbr

Setting this switch to on changes the search order to:

.int
.gnt
.lbr

See Also:

program_search_order run-time tunable


I2 - Run-time System Error Redirection

Redirects run-time system errors to STDERR

Properties:
Default: Off
Environment: 16-bit shared run-time system on DOS and OS/2
Comments:

The I2 switch is only enabled when used in conjunction with the +S5 switch.

If set off run-time system error messages are sent to STDOUT (standard output). If set on the error messages are sent to STDERR (standard error).

On OS/2 messages sent to STDERR can be redirected using the "2>" operator on the command line.

This switch has no effect when running on Windows.

See also:

S5 RTS switch


K - Indexed Files Sequence Check

Enables sequence-checking of keys in indexed files.

Properties:
Default: Off
Environment: UNIX
Comments:

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.


K1 - Old Keyboard Handling

Enables the use of old keyboard BIOS calls.

Properties:
Default: Off
Environment: 16-bit run-time systems
Comments:

Setting the K1 switch to on enables the COBOL system to be used on a new IBM PC keyboard in conjunction with a keyboard resident program which knows only about the old IBM PC keyboard BIOS routines.


K2 - Extended Keyboard Handling

Enables the use of extended keyboard BIOS calls.

Properties:
Default: Off
Environment: 16-bit run-time systems
Comments:

Setting the K2 switch to on enables the COBOL system to be used on a new extended IBM PC keyboard in conjunction with a keyboard resident program which knows only about the old IBM PC keyboard BIOS routines.


K3 - Shift+Ctrl+Break Behavior

Enables you to bring up and switch to an operating system command prompt by pressing the Shift, Ctrl and Break keys simultaneously.


Warning! If you use this switch and enter the new command shell you should be very careful about which commands you use.


Properties:
Default: Off
Environment: 16-bit shared run-time system
Comments:

The K3 switch is turned on automatically in the COBOL development environments such as Workbench and Professional COBOL.

To leave the command prompt and return to your COBOL application, use the exit command.

The K3 switch should be used with caution; if a disk clean-up facility (for example, CHKDSK /F) is used while in the new command shell and the application had any open files when the new command processor was loaded, the file system can become corrupted.


K4 - RTS Error Behavior

Causes run-time system error messages to stay on the screen until a key is pressed.

Properties:
Default: Off
Environment: 16-bit shared run-time system and 32-bit on Windows NT and OS/2 V2
Comments:

This is useful in batch runs where you want to know if any program terminates with a run-time system error message, or in a system that displays menus, where RTS error messages can sometimes be quickly overwritten.


L - Auto-fail Critical Errors

Causes any critical I/O errors (for example "Disk drive door not closed") to return control immediately to the user program with an appropriate file status or error

Properties:
Default: Off
Environment: 16-bit run-time systems
Comments:

Usually, these conditions make the program pause with a message enabling the user to abort, retry, fail or ignore the error. Setting the L switch on suppresses this message so that all error handling can be controlled by the application.


l - Memory

Enables you to set the maximum amount of memory to be made available to the run-time system, or to cause the run-time system to perform physical cancels instead of logical cancels.

Properties:
Default: The maximum number of bytes available to the run-time system.
Environment: UNIX
Comments:

This switch is lower-case "L", not upper-case "I".

The format of this switch is lnnnnnn, where nnnnnn is the amount of memory in bytes to be made available to the run-time system.

You can use this switch to limit the amount of memory the run-time system will use. This might be useful to enable you to tune your system.

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 physical 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 physical, 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.

Statically linked COBOL programs cannot be physically canceled because they cannot be removed from memory.

Duplicate entry point names are not allowed in statically linked programs; you must ensure that all such programs have unique entry point names.

Logical cancels behave in the same way as these physical cancels under statically linked programs. Therefore, an application developed using .int and .gnt files with logical cancels should exhibit the same behavior when generated as object code files and statically linked. However, if you used physical cancels and duplicated entry point names while developing the application, the application might fail to static link.

See Also:

dynamic_memory_limit run-time tunable


L1 - Exception Popup Window

Disables the interactive popup window that appears when an exception error occurs while running on OS/2 or Windows.

Properties:
Default: Off
Environment: 16-bit run-time systems
Comments:

Instead of the interactive popup window, a general OS/2 or Microsoft Windows error message is displayed and control is returned to the operating system prompt without any user intervention.


L2 - Record Terminator

Determines the character(s) to be used as the record terminator when reading a line sequential file.

Properties:
Default: Off
Environment: All
Comments:

DOS, OS/2 and Windows:
On DOS, OS/2 and Windows, when off (-L2), x"0A" is taken as the record terminator. This provides compatibility with COBOL for UNIX.

UNIX:
On UNIX, when off (-L2), x"0A" or "0D0A" is taken as the record terminator. This provides compatibility with COBOL for DOS, Windows and OS/2.

DOS, OS/2, and Windows:
On DOS, OS/2, and Windows, when on (+L2), x"0D0A" is taken as the record terminator. This provides compatibility with earlier versions of this system, correctly reading files written using a WRITE ... AFTER ADVANCING statement.

UNIX:
On UNIX, when on (+L2), x"0A" is taken as the record terminator. This provides compatibility with earlier versions of this system, correctly reading files written using a WRITE...AFTER ADVANCING statement.

This switch only affects read operations and not write operations.


L5 - LEVEL II COBOL File Compatibility

Enables the COBOL system to determine the size of sequential or relative files created by Micro Focus LEVEL II COBOL, which are padded out to a 128-byte boundary with x"1A" characters.

Properties:
Default: Off
Environment: 16-bit run-time systems
Comments:

You must set this switch to handle sequential or relative files created using Micro Focus LEVEL II COBOL.

This switch can only be used for non-shared files.


L6 - Subprogram Directory Search Order

Changes the way the run-time system searches for subprograms.

Properties:
Default: On
Environment: 16-bit shared run-time system
Comments:

When this switch is on, the RTS searches for subprograms, first in the directory from which the calling program was loaded, and then in the directories specified in the environment variable COBDIR.

When this switch is off, subprograms are searched for first in the current directory and then in the directories specified in COBDIR.


L - Number of Record Locks

Specifies the number of record locks that can exist at any one time.

Properties:
Default: /L200
Environment: 16-bit shared run-time system
Comments:

The maximum number you can specify is 600.

The number applies to all locks held by the system and not for each file.


M - command.com Transient Area

Makes the command.com transient area available for use by the application.


Warning! Setting this switch prevents the last command entered from being saved in the buffer; therefore, you are unable to use the standard DOS command line editing facility.


Properties:
Default: Off
Environment: 16-bit shared run-time system on DOS
Comments:

Using this switch increases memory by 21K on DOS 3.3 and by 28K on DOS 4.x and above.

We recommend that you do not set this switch if you are running your application from a batch file.


M2 - Active Program Discard

Prevents the run-time system from paging out procedure code of an active program.

Properties:
Default: Off
Environment: 16-bit shared run-time system
Comments:

When this switch is off, the RTS memory manager, when short of free memory, discards procedure code of currently active programs. Discarded code is reloaded when it next needs to be executed. This can cause "out of memory" errors if there is no room to reload a program when a subprogram it has called returns to it. If this switch is on, procedure code of currently active programs is not discarded; thus you never get a "memory full" error when a subprogram returns. Applications using this switch should use the ON EXCEPTION/OVERFLOW syntax to check for memory being full when a subprogram is called.


M - Number of Heaps

Specifies, in multiples of 128, the number of heaps available for each application.

Properties:
Default: /M3 (That is, 3 x 128 heaps.)
Environment: 16-bit shared run-time system
Comments:

The default number of heaps made available for each application is 384. System software uses some of the heaps made available to an application, so the number of heaps usable is slightly less than the number specified.

You might need to increase the number of heaps when animating large applications.

The only possible settings of this switch are: /M1, /M2, /M3 and /M4.


N - Null

Enables null insertion for all line sequential files in your program.

Properties:
Default: On
Environment: All
Comments:

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, if you try to read a file with one setting which was written 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:


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, Windows and OS/2.


When the N switch is off:

Example:

The command:

DOS, OS/2 and Windows:
myprog (-N)

UNIX:
cobrun -N myprog

loads the program myprog and specifies that, in line sequential files, all characters less than or equal to 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

Enables run-time system error 48 ("Attempt to divide by zero").

Properties:
Default: On
Environment: All
Comments:

A program compiled with CHECKDIV"OSVS", CHECKDIV"VSC2" or CHECKDIV"COBOL370" set produces run-time system 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.

See also:

CHECKDIV Compiler directive


P - High-level Printer I/O

Causes the DOS shared run-time system to perform its printer I/O by calling a standard DOS routine instead of by invoking standard BIOS routines.

Properties:
Default: Off
Environment: 16-bit shared run-time system on DOS
Comments:

This switch is particularly useful when accessing a printer attached to a local area network or when accessing slow local printers which keep timing out because their buffers are full.

With the P switch set, the system cannot detect whether the printer is available when it is opened; only when an attempt is made to write to it.


p - Dynamic Linkage Fixup

Causes the run-time system to set the addressability for all Linkage Section items in a program when it is called.

Properties:
Default: On
Environment: UNIX
Comments:

This switch is lower-case "p".

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.


P1 - Bell Enhancer

Sounds the system bell by using a call to the BIOS.

Properties:
Default: On
Environment: 16-bit run-time systems
Comments:

Normally, the system sounds the bell by accessing the hardware directly. On some clone machines this does not work, and the bell can only be sounded via the BIOS. Setting this switch makes the system sound the bell via the BIOS.


P2 - Logical Cancel

Enables support for logical cancels in the run-time system.

Properties:
Default: Off
Environment: 16-bit shared run-time system
Comments:

By default the CANCEL statement physically cancels a program from memory. A subsequent call to that program requires the program to be physically reloaded from disk.

If you specify +P2, the memory for a program is not released when it is canceled, though the run-time system marks it as logically canceled. So, a subsequent call to that program does not need it to be reloaded from disk; the RTS simply reinitializes the copy of the program already in memory.

See Also:

For the equivalent function on UNIX, see the -l (lower case "L") switch.


P3 - Programs Loadable

Increases the number of programs that can be loaded at a time from approximately 200 to approximately 400.

Properties:
Default: Off
Environment: 16-bit shared run-time system on DOS with XM, on Windows and on OS/2
Comments:

Changing the setting of the /S switch to give a larger stack reduces the number of programs that can be loaded at a time. If you have a large application or need to increase the size of the stack, we recommend you set this switch.

See also:

/S RTS Switch


P - Security Key Port Address

Specifies the address of the parallel port to which the security key is attached.

Properties:
Default: /P956
Environment: 16-bit run-time systems
Comments:

The system first looks for a security key in the port specified by this switch, the default being the standard IBM port address. If a security key is not found at this address, addresses 632 and 888 are checked.

You might need this switch if you are using a clone machine that has nonstandard parallel port addresses.

See also:

RETRYLOCK Compiler directive
RM Compiler directive


Q - File Status Error

Maps extended file status codes (9/nnn) to a status that conform to the statuses returned in the COBOL dialect of your choice.

Properties:
Default: Off
Environment: UNIX
Comments:

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 Programmer's Guide to File Handling for details of how to configure the COBOL dialect you want to use. See your Language Reference for full details on file status errors.


R - Retry Locked Record

Repeats the read operation on a record that is found to be locked until the record becomes available.

This switch is maintained for compatibility with older COBOL systems. Use the RETRYLOCK Compiler directive instead. The RETRYLOCK directive gives the same functionality, and creates a program that is portable to other environments. The R switch will be removed in a future version of this COBOL system.


Warning! This feature makes possible a deadly embrace. One program might have locked record A and be trying to read record B, while another program has locked record B and is trying to read record A. Should this happen you will probably have to reboot your system.


Properties:
Default: Off unless the program is compiled with the RM directive.
Environment: 16-bit run-time systems
Comments:

This affects files of any organization which are open for input or I-O and which have no file status item declared.

If this switch is set to off and a read is tried on a record which is locked, the read is not tried again.

This switch is overridden by the RETRYLOCK Compiler directive.


S - Sort

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.

Properties:
Default: Off
Environment: 32-bit and 64-bit run-time systems
Comments:

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 environment variable, TMPDIR on UNIX, TMP on Windows NT and OS/2 V2. If this environment variable is not set, the system default temporary directory is used instead.


s - Sort Memory

Specifies the amount of memory used as an internal workspace when performing a SORT operation.

Properties:
Default: -s3145728 (3 Mbytes)
Environment: UNIX
Comments:

Setting this switch specifies the amount of memory used in bytes.

This switch can make your application run more slowly.


S2 - Video Snow

When set, indicates that the system need not wait for the vertical retrace signal to be active before accessing the video RAM.

Properties:
Default: Off
Environment: 16-bit run-time systems
Comments:

This is a specialist switch for use only on IBM compatible PC's where the need for protection of the video RAM is different to that on a standard IBM PC, AT or PS/2.

If S2 and S3 are both off, the system determines the setting automatically. On some machines it might choose the wrong setting.


S3 - Video Snow

When set, indicates that the system must wait for the vertical retrace signal to be active before accessing the video RAM.

Properties:
Default: Off
Environment: 16-bit run-time systems
Comments:

This is a specialist switch for use only on IBM compatible PC's where the need for protection of the video RAM is different to that on a standard IBM PC, AT or PS/2.

If S2 and S3 are both off, the system determines the setting automatically. On some machines it might choose the wrong setting.


S5 - ansi.sys-compatible Console I/O

Enables ansi.sys-compatible console I/O.

Properties:
Default: Off
Environment: 16-bit shared run-time system on DOS and OS/2, and 32-bit for Windows NT and OS/2 V2
Comments:

This function is achieved by the run-time system forcing all ACCEPT FROM/DISPLAY UPON CONSOLE statements to be executed such that I/O to and from the screen and keyboard can be redirected by using the ">" and "<" operators on the DOS or OS/2 command line.

This switch has no effect when running under the 16-bit run-time system on Windows.


S6 - DISPLAY Attributes Behavior

Changes default behavior of attributes for DISPLAY ... UPON CRT of non-Screen Section items.

Properties:
Default: Off
Environment: 16-bit run-time systems
Comments:

When attributes have been written to a screen area with a DISPLAY statement using a data item that is not in a Screen Section, a DISPLAY statement with no attribute specification uses, by default, the attributes already existing in that area. If the +S6 switch is specified at run time, normal attributes are used instead.

When attributes have been written to an area on the screen with a DISPLAY of a Screen Section item, a subsequent DISPLAY in that area with no attribute specified inherits those attributes regardless of the setting of the +S6 switch.

This switch also affects screen displays done using Panels.


S - Stack Size

Specifies, in bytes, the default size of the PERFORM/CALL stack.

Properties:
Default: /S8192
Environment: 16-bit shared run-time system.
Comments:

The number of bytes follows the /S immediately, without a gap.

We recommend that you do not set a stack size larger than 32K (/S32768).

You should always ensure that the stack size you set is the minimum required by your application.

Setting the /S switch affects the number of programs that may be loaded at any time. The default stack size of 8K allows for around 200 programs to be loaded; any increase in stack size reduces that number. A stack of 32K allows only 80 programs to be loaded. If you need to increase the setting of the /S switch, consider setting the +P3 switch as well. Assuming a stack of 32K, this increases the number of programs from 80 to approximately 200 again.

Example:

/S8192 sets a stack size of 8192 bytes.

See also:

/E RTS switch
P3 RTS switch


T - Tab

Enables insertion of tab characters in all line sequential files.

Properties:
Default: Off
Environment: All
Comments:

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 8 character positions (for example, 9, 17, 25) 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.

With this switch set to off, all spaces in a line sequential file are written to disk as space characters.


Z - DBCS Space Conversion

Enables conversion of double-byte character set (DBCS) spaces to ASCII spaces when reading a line sequential file or input from the console.

Properties:
Default: Off
Environment: UNIX
Comments:

DBCS spaces such as x"8140" for Shift-JIS and x"A1A1" for EUC in Japanese environments are converted to ASCII spaces x"2020".

See Also:

DBSPACE Compiler directive


Z - Dummy Parameters

Dummy parameters switch.

Properties:
Default: /Z0 (no dummy parameters)
Environment: 16-bit shared run-time system
Comments:

Specifies how many dummy parameters should be passed to a main program which uses the Pascal calling convention (call convention 3). The switch has the format /Znnn where nnn is the number of dummy parameters.


Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

PreviousRun-time Configuration The COBOL ProfilerNext"