Operating Environment and Run-Time System [ HP Micro Focus COBOL/iX Implementation Notes ] MPE/iX 5.0 Documentation
HP Micro Focus COBOL/iX Implementation Notes
Operating Environment and Run-Time System
This section contains Hewlett-Packard specific information about the HP
Micro Focus COBOL/iX operating environment. It includes information
about HP Micro Focus COBOL/iX's interface to MPE/iX, and information
about the HP Micro Focus COBOL/iX Run-Time System (RTS).
Restrictions
* Filenames that contain colons cannot be mapped using environment
variable logical filename mapping.
* You cannot use magnetic tape access to unblocked devices.
Multiple reel and rewind syntax does not cause compiler errors,
but is ignored at run-time.
* You should not use the X"B7" call with HP Micro Focus COBOL/iX
ACCEPT and DISPLAY statements that specify attributes. The call
affects screen attributes and there may be inconsistency with
screen attributes from the ACCEPT or DISPLAY statements.
If you have used the X"B7" call, any subsequent ACCEPT or DISPLAY
statements that place text in the area of the screen affected by
the call will take effect only if no other ACCEPT or DISPLAY
statements were executed that specified the same attributes.
Otherwise, the attributes are not defined.
* Options specified with the -Q option are ignored and not passed to
the system linker.
* The -p option of the cob command may cause run-time errors.
* The CICS compiler directives are not supported at run-time by HP
Micro Focus COBOL/iX. The compiler does accept them, however.
* File names that are used in mapping must begin with one of the
characters A .. Z, a .. z, or 0 .. 9. If you are using dd_
logical file names the first character must be alphabetic.
Operating Environment Notes
* The Memory Switch (l)
The COBOL/HP-UX Operating Guide briefly describes the Memory
Switch. Here is some additional information to help you
understand how the Memory Switch works and how to use it.
The Memory Switch (COBSW=-l<n>) provides you with the ability to
control the amount of memory available to the individual COBOL
process for which the switch has been set. The switch allows you
to select whether CANCEL statements, as performed by the RTS on
int code, are logical or real cancels.
Regarding memory usage, the only difference between a logical
cancel and a real cancel is that a real cancel will return the
memory allocated to the canceled program to the operating system
via the free() system call. However, you must understand that the
memory that has been returned to the operating system is still
actually allocated to your process and has actually only been
returned to the free pool available to the memory allocator,
malloc(), for that process.
If you do not set the memory switch (the default), the RTS limits
the available memory to the user process to be the maximum amount
available from the operating system. In addition, all int cancels
are logical.
By setting the memory switch with COBSW=-l0, the available memory
is still the operating system limit, but all cancels are real. As
noted above, be aware that even though you are doing real cancels,
the processes DATA space will not shrink. The memory that is
freed is returned to the free pool available to malloc() for that
process.
If you wish to limit the available memory for each COBOL process,
you must set the memory switch to a non-zero value that indicates
the number of bytes of memory available to the process. When this
is done, the RTS will continue to do logical cancels until a
situation arises when a called program does not fit in the
available memory. At this time, the RTS frees the memory that is
allocated to any previously canceled programs (remember that
previously canceled programs were only logically canceled). If
the called program will not fit into the available memory, even
after freeing the memory used by all previously canceled programs,
an exception or memory allocation error occurs on the CALL
statement.
The design of this last feature of the memory switch, the ability
to limit the available memory for a COBOL process, makes
assumptions about the underlying memory manager that make it
impossible to implement in a portable manner. The assumption
being made is that all memory that has been freed is available as
one contiguous chunk for future memory needs. Unfortunately, this
is not true under some operating systems, including MPE/iX, and
therefore, makes it impossible to ensure that the value specified
by the memory switch as the limit of available memory will be the
true limit. Depending on the order of CALL and CANCEL statements,
situations may arise where a process allocates more memory than
what is specified with the memory switch and situations where a
memory allocation error occurs when there should be memory
available to load a program.
Therefore, the conclusion that can be made, knowing how the memory
switch has been designed and implemented, that you should only use
the memory switch to control whether logical or real cancels
occur. However, if you still wish to limit the memory available
to your processes, be aware that your processes may allocate more
memory than has been specified by the memory switch.
* In addition to the run-time switches supported by Micro Focus, HP
has added some new HP-only switches. The following descriptions
describe the effect of the switches when they are set on. In all
cases, if the switch is set off, the opposite effect occurs. The
default setting, if the switch is not set by the user, is also
given. These switches can be set in the HPCOBSW environment
variable by placing + (on) or - (off) before the switch.
File I/O Buffering Switch (b)
Allows file I/O buffering for all
sequential, line sequential, and
relative files.
Default: On
Tab Switch (T)
Enables the expansion of tab
characters to spaces, on input
from all line sequential files.
Default: On
When the switch is set to off, all
tabs in a line sequential file are
read from disk as tab characters.
* The program counter (pc) values for native code generated files
and for executable files are not defined.
* Change the 256 byte conversion table within the CODESET program to
reconfigure _CODESET.cbl. _CODESET.cbl is provided with HP Micro
Focus COBOL/iX. Use the binary value of the source character +1 to
index into the table. The character at this index point is the
target character.
_CODESET accepts three parameters. The compiler uses these
parameters to convert text strings into either EBCDIC or ASCII
text depending on the type of statement used.
The first parameter is a flag (PIC 9(2) COMP-X) that has one of
the following values:
0 The buffer contains EBCDIC data and data of the specified
length will be converted to ASCII.
1 The buffer contains ASCII data and data of the specified
length will be converted to EBCDIC.
2 The 256 byte EBCDIC to ASCII conversion table that is used
for flag type 1 is moved into the data area. The length
parameter is ignored, and 256 bytes are moved.
3 The 256 byte ASCII to EBCDIC conversion table that is used
for flag type 1 is moved into the data area. The length
parameter is ignored, and 256 bytes are moved.
The second parameter is the length of the buffer (PIC 9(9)
COMP-X).
The third parameter is the name of the buffer.
Recompile _CODESET.cbl so that the compiler will call the correct
version of _CODESET.cbl.
Statically link the new version of _CODESET.cbl by creating an
object file. Create the file with the following command:
cob -xc CODESET.cbl
Put the resulting _CODESET.o file into
$COBDIR/coblib/libcobol.a
* Subfunction 59 of the RTS CALL X"91" is available for
compatibility with previous versions of HP Micro Focus COBOL/iX.
You should not use it in new programs.
* If you use the -X flag on the cob command line of complex programs
to exclude certain modules from the executable output file, the
resulting file may not be any smaller than it would have been
without the flag. Setting the flag assures that HP Micro Focus
COBOL/iX will return a meaningful runtime error message if you
call an excluded module at runtime.
* If you specify an unacceptable entrypoint name during linking, you
will receive the following error message.
Object module generation error: module name is not
a valid entrypoint name.
To correct the error, specify a valid entrypoint name, using the
-e cob option.
* A file, filename.ipf, is produced each time that you run a program
that was compiled with the PROFILE directive set (filename is the
program name). If an executable file was the result of the
compilation, filename will be the first entrypoint name in the
executable file.
* Programs that are called at link-time must have names that the
assembler can interpret. The assembler can only interpret names
made up of the characters 0 to 9, A to Z, a to z, underscores, and
hyphens. The object module converter will assume that programs
with names that contain other characters are to by dynamically
linked, and will not pass them on to the linker.
* If the COBCAP or DD_ environment variables have been set up so
that commands are executed by the MPE/iX Shell, the shell that
will execute the commands will be the shell defined in the SHELL
environment variable. If the SHELL environment variable is not
set the shell will be /sys/hpbin/sh.
MPE/iX 5.0 Documentation