HP COBOL II/XL Language Dependencies [ HP COBOL II/XL Reference Manual ] MPE/iX 5.0 Documentation
HP COBOL II/XL Reference Manual
HP COBOL II/XL Language Dependencies
HP COBOL II/XL language dependencies are features of HP COBOL II/XL that
depend on the MPE XL operating system. Often they are tailored to the
architecture of the computer on which MPE XL runs. This section groups
these language dependencies by what they affect--the program division or
interprogram communication.
IDENTIFICATION DIVISION
In the IDENTIFICATION DIVISION, the compiler uses the name specified in
the PROGRAM-ID paragraph to generate an external name according to the
following conventions:
* Long names are truncated to 30 characters.
* All uppercase characters are converted to lowercase unless the
first character of the name is a backslash (\).
* If a name begins with a backslash, it is interpreted literally as
beginning with the character after the backslash.[REV BEG] No
conversion to lowercase or uppercase is performed. As with other
non-numeric literals, the backslash and name must be enclosed in
quotation marks.[REV END]
* Hyphens are converted to underscores (unless $CONTROL CMCALL is
specified).
ENVIRONMENT DIVISION
The following are dependencies in the ENVIRONMENT DIVISION:
* The RESERVE clause of the SELECT statement is ignored in HP COBOL
II/XL. This is because the clause is used to allocate input/output
buffers and buffers are not used on MPE XL systems.[REV BEG]
* In the ASSIGN clause, an operating system file designator is of
the following form:[REV END]
file/lockword.group.account
This is the fully qualified form of a file name. If the file
exists in your log-on group, then you need to specify only the
file parameter and any lockword assigned to it. If the file
exists in a group other than your log-on group, you must specify
the file (and lockword, if any), and the group where the file
resides. Finally, if the file exists in a group and account other
than your log-on, you must use the fully qualified file name. If
the file resides in a group or account other than your own, you
must have access to the file.
* In the ASSIGN clause, the device parameter allows you to select a
file system defined device type (such as DISC, TAPE, or LP) or a
private volume. If you omit this parameter, the default device
type, DISC, is assumed. If this parameter is followed by a left
parenthesis, the CCTL (carriage control) option is assumed. CCTL
is described in Chapter 6 , "Environment Division."
* In the ASSIGN clause, the file-size parameter can be a maximum of
nine digits long. If omitted, a file size of 10,000 records is
assigned by default.
DATA DIVISION
The following are dependencies in the DATA DIVISION:
* Word size--The word size on MPE XL systems is 32 bits or 4 bytes.
* Index names--Index names are 4 bytes long.
* Subscripts--The performance when referencing table elements using
subscripts defined as PIC S9(9) COMP SYNC is the same as
referencing table elements using index names.
* Synchronization--The default synchronization is on 32-bit
boundaries.
* LINAGE-COUNTER--The LINAGE-COUNTER is a 9-digit unsigned integer.
* CODE-SET clause of the FD entry--The CODE-SET clause specifies the
character code convention used to represent the data in the file
(ASCII, EBCDIC, EBCDIK, STANDARD-1, STANDARD-2, or NATIVE). The
default is ASCII.
* Optimal data types--Chapter 3 of the HP COBOL II/XL
Programmer's Guide provides a discussion of optimal data types.
PROCEDURE DIVISION
The following are dependencies in the PROCEDURE DIVISION:
* Segmentation--The MPE Segmenter is not available on MPE XL
systems. The HP COBOL II compiler ignores segment numbers after
section names (except where ALTER and alterable GO TO statements
exist). No performance gain is achieved by including segment
numbers after section names. The function formerly accomplished
by segmenting an HP COBOL II program using section numbers is
provided by the memory manager of the MPE XL operating system.
* ACCEPT Statement--An ACCEPT operation prematurely terminated by an
:EOD or :EOJ (in job mode) causes a read error condition and abort
of the program.
* DISPLAY Statement--The format of output when displaying unedited
signed numeric data items is improved in HP COBOL II. For signed
items, the sign overpunch is removed and a leading minus or plus
sign is printed. A decimal point is inserted where applicable.
For example, if the data item A is declared as PIC S999V99 and has
the value 1.3, and the following statement is executed:
DISPLAY A
The result would be:
+001.30
[REV BEG]
The console device when you use UPON CONSOLE is assumed to be 50
characters long. The SYSOUT device when you use UPON SYSOUT is
assumed to be 132 characters long. If the data you display is
longer than these, it will be displayed on multiple lines.
Escape sequences are stripped out of the data when displayed UPON
CONSOLE.[REV END]
* Error Handling--Decimal data is not checked for validity unless
you specify the control option VALIDATE. When you specify this
option, a program aborts on the following conditions:
* Illegal ASCII digit.
* Illegal decimal digit.
* Illegal signs.
Your program may abort with the following conditions:
* Division by zero.
* An overflow condition occurs without an ON SIZE ERROR
phrase.
Using a common point to exit from multiple PERFORM statements may
also cause errors in HP COBOL II. If too many common exit points
from PERFORM statements are found, an error message is issued at
run time. Using the control option BOUNDS causes the compiler to
generate code to see if the paragraph stack overflows.
In addition, illegal GO TO statements (those that branch out of
PERFORMed paragraphs) cause a program to abort in HP COBOL II.
Using control option BOUNDS causes the program to trap instead.
You can control the run-time trap handling environment by setting
the MPE XL variable COBRUNTIME (see the section "Run-Time Trap
Handling" and the HP COBOL II/XL Programmer's Guide for more
information).
* EXCLUSIVE/UN-EXCLUSIVE Statement--The following applies to the use
of the EXCLUSIVE statement:
Programs that are updating or adding to the file must utilize a
run-time file equation with the "SHR" option specified to permit
other programs to share the file.
Programs that want READ ONLY access to the file may improve
performance when the program is not concerned with data currency,
but is currently sharing the file with other programs that are
concerned with data currency. The program must specify either the
"L" option within the SELECT statement of the file, or the "LOCK"
option on a run-time file equation without utilizing the
EXCLUSIVE/UN-EXCLUSIVE statement in the PROCEDURE DIVISION. This
enables HP COBOL II to open the file with dynamic locking
specified, but to refrain from actually locking it for input
operations.
The COBOLLOCK and COBOLUNLOCK procedures are not available in HP
COBOL II/XL. Use the EXCLUSIVE and UN-EXCLUSIVE statements
instead.
_________________________________________________________________
NOTE Use of an EXCLUSIVE statement for a file causes any OPEN of
the same file to be executed with the dynamic locking
facility enabled.
_________________________________________________________________
[REV BEG]
* OPEN Statement--INDEX organization files are implemented as MPE
KSAM files. Compatibility Mode KSAM files use two files, a data
file and a key file. The key file name for an INDEX file is the
data file name plus the letter "K". If the file name is already
eight characters long, the last character is replaced by "K".
Native Mode INDEX files use one Native Mode KSAM file. When only
ANSI85 is specified, files with U or V type records will not be
checked for record length mismatch. For more information, see the
HP COBOL II/XL Programmer's Guide.
* PERFORM Statement--The following are illegal PERFORM constructs on
HP COBOL II/XL:
* PERFORM statements with a common exit point.
* PERFORM statements where the exit point of one PERFORM
statement is contained within the range of another,
subsequently called PERFORM statement.
These two illegal cases are illustrated in Figure H-3 below.[REV END]
Figure H-3. Invalid PERFORM Constructs
[REV BEG]
NOTE The behavior of illegal PERFORM constucts is not always consistent.
The compiler does not flag these constructs as errors.
[REV END]
MPE/iX 5.0 Documentation