HP 3000 Manuals

Run-Time Switches [ COBOL/HP-UX Operating Guide for the Series 700 and 800 ] MPE/iX 5.0 Documentation


COBOL/HP-UX Operating Guide for the Series 700 and 800

Run-Time Switches 

Run-time switches 
affect 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.

Animator Switch (A) 

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

Default:              Off

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

Skip Locked Record Switch (B)  

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

Default:              Off

Set this 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.

Dynamic Paging Buffer Switch (d) 

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

Default:              250 Kbytes

Dynamic paging is used by programs such as the Compiler and Generator,
and 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 will page any further
requirements onto disk.  By default, the run-time system allocates up to
250 Kbytes for dynamic paging buffers.

For example, when compiling a large COBOL program, the amount of memory
for dynamic paging buffers may be exceeded due to the Compiler requiring
a large amount of dictionary to store the symbol table it creates.  If
the dynamic paging buffer space is exhausted, the run-time system will
then start 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.  For example, to double the amount of
memory the run-time system could use before paging to disk, you would set
the COBSW environment variable as follows:

     COBSW=-d500000

Standard ANSI COBOL Debug Switch (D) 

Invokes the standard ANSI COBOL Debug module.

Default:              Off

See your Language Reference for a description of the Debug facilities.
This switch must be set on the command line.  For example, the command:

cobrun +D myprog.int

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

COBOL Symbol Switch (e)  

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

Default:              On

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

Error Switch (E)  

Executes intermediate code which contains S-level compiler errors.

Default:              Off

If you try to run intermediate code programs which contain S-level
compiler errors when this switch is set to off, you will receive a
run-time error.  See your Error Messages for full details on these
errors.

Compatibility Check Switch (F)  

This switch enables run-time searching for some incompatible data
conditions in which the contents of an item being referenced are
incompatible with the PICTURE clause for that item.  It generally has an
effect only when running programs as intermediate code.  For example, an
ADD statement may reference a PIC 9 item that contains a nonnumeric
value.  The result of referencing such incompatible data is undefined (in
line with ANSI'85 COBOL) and may give different run-time results between
intermediate code and generated code versions of the program running on
different processors or operating systems.

Default:              On

When such data is detected and the switch is on, the program will fail
with the run-time error 163 "Illegal character in numeric field".

If this switch is off and incompatible data is referenced by the program,
it may behave normally or it may give unexpected results.

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 non-numeric value, resulting in run-time error 163.

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 will give 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 compile time option SPZERO to
disable these numeric optimizations.

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 "non-zero"     Displays "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"

Keyboard Interrupt Switch (i)  

Allows you to turn keyboard interrupt enabling on or off.

Default:              On

Memory Switch (l) 

Allows you to set the amount of available memory.

Default:              Iinteger 

where integer is the maximum number of bytes available to the run-time
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 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 set integer to be zero.

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.

Indexed Files Sequence Check Switch (K) 

Allows you to enable or disable sequence-checking of indexed keys in
indexed files.

Default:              Off

This switch allows you to specify if records can be written in any order
to indexed files opened in sequential mode, or if these records must be
written in key sequence.

Null Switch (N) 

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

Default:              On

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"20"), 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 allows 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"20" 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"0A" is appended to
       terminate the record.

   *   the file is read as records, some of which may 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"20".  CR (x"0D"), LF
         (x"0A"), TAB (x"09"), NUL (x"00"), and EOF (x"1A") are all
         recognized control characters on UNIX.

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"20").

   *   trailing spaces are removed on output to disk, and a record
       terminator of x"0A" is appended to terminate the record.  Printer
       control characters can 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.

For example, the command:

cobrun -n myprog

loads the program myprog and specifies that in line sequential files, all
characters less than x"20" except for TAB and the file control characters
are treated as data.  Null is not inserted before data characters less
than x"20" on output.

Dynamic Linkage Fixup Switch (p) 

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

Default:              On

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.

File Status Error Switch (Q) 

Allows you to map status '9' file errors to a status that conforms to the
statuses returned in the COBOL dialect of your choice.

Default:              Off

Setting this switch on causes all status '9' file errors 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 Chapter 18
, File Status for details of how to configure the COBOL dialect you
wish to use.  See your Language Reference for full details on file status
errors.

Sort Memory Switch (s) 

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

Setting this switch specifies the amount of memory used in bytes.  Note
that this switch can adversely affect the speed of your application.

Default:              Off

Sort Switch (S) 

Causes duplicates in all SORT statements to be ordered.  This switch has
the same effect on MERGE statements as on SORT statements, although the
WITH DUPLICATES IN ORDER phrase is valid syntax only for SORT statements.

Default:              Off

Setting this switch is the only available method of ensuring that all
duplicates in a SORT statement are in order, as 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).
See Appendix I , Environment Variables for details.

Tab Switch (T)  

Enables insertion of tab characters in all line sequential files.

Default:              Off

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 will not affect any trailing spaces
as these are not part of the line sequential record, and they will be
removed on output.  Tab positions are every 8 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