[an error occurred while processing this directive]

HP OpenVMS Systems Documentation

Content starts here

HP COBOL
Reference Manual


Previous Contents Index

Use more tab characters only when necessary. Compiler error diagnostics result if you use tab characters beyond the permissible character positions for a COBOL statement or entry. The following example shows how the compiler treats source program lines 000004 and 000005. Line 000004: contains one too many tab characters, which places paragraph-name P0 out of Area A.

Shortened ANSI Format Source Line


000001[Tab]IDENTIFICATION DIVISION.
000002[Tab]PROGRAM-ID. ANSI-TEST.
000003[Tab]PROCEDURE DIVISION.
000004[Tab][Tab]P0.
000005[Tab][Tab]STOP RUN.

Listing File Result on OpenVMS Alpha, I64


000001 IDENTIFICATION DIVISION.
000002 PROGRAM-ID. ANSI-TEST.
000003 PROCEDURE DIVISION.
000004   P0.
.........^
%COBOL-F-UNDEFSYM, Undefined name
at line number 4 in file DISK:[DIRECTORY]ANSI.COB;1

000005  STOP RUN.
........^
%COBOL-W-SYN6, Missing paragraph header
at line number 5 in file DISK:[DIRECTORY]ANSI.COB;1  <>

Listing File Result on OpenVMS VAX


    1  000001 IDENTIFICATION DIVISION.
    2  000002 PROGRAM-ID. ANSI-TEST.
    3  000003 PROCEDURE DIVISION.
    4  000004     P0.
                  1
%COBOL-F-ERROR  349, (1) Undefined name
    5  000005     STOP RUN.
                  1
%COBOL-W-ERROR  325, (1) Missing paragraph header   <>

Listing File Result on Tru64 UNIX


000001 IDENTIFICATION DIVISION.
000002 PROGRAM-ID. ANSI-TEST.
000003 PROCEDURE DIVISION.
cobol: Severe: dwork/t.cob, line 4: Undefined name
000004  P0.
--------^
cobol: Warning: dwork/t.cob, line 5: Missing paragraph header
000005  STOP RUN.  <>
--------^

Note

The previous error messages have no additional online explanations. If a diagnostic message has a further explanation, an asterisk (*) is displayed (to the left of the error message). On OpenVMS Alpha and I64 systems, the HP COBOL online help file lists and describes error messages that have further explanations.

1.3.2 Terminal Format

The HP COBOL terminal format shortens program preparation time and reduces storage space for source programs. This format eliminates the sequence number and identification areas. It also combines the indicator area with Area A. Except for the differences described in this section, the rules for ANSI format also apply to terminal-format source programs.

In terminal format, the compiler recognizes the following valid indicator area characters in the first character position:

(-) hyphen
(*) asterisk
(/) slash

The compiler also recognizes the following conditional compilation line characters as valid indicator area characters in the first and second character positions:

(\x) backslash and x

where x can be any uppercase or lowercase alphabetic character.

Area A then begins in character position 2 (or 3 if using \x). Otherwise, Area A begins in the first character position.

Area B begins four character positions to the right of the beginning of Area A. It ends when the compiler detects a carriage return, or at Margin R.

The maximum length of a terminal-format source line is 256 characters. The compiler's tab stops are immediately to the right of Margin B, and every eight character positions to the right, until the end of the line.

Note

The maximum length of the source line on the program listing is 125 characters, including the sequence field. The compiler processes the complete source line but displays only the first 125 characters on the listing. It also replaces all nonprintable ASCII characters with periods (or other symbols depending on the device) in the listing file. (Refer to the HP COBOL User Manual.)

The following example shows source lines in terminal format. It is equivalent to the ANSI-format source line examples in the previous section.


*The following record description shows the source line format[Return]
01[Tab]RECORD-A.[Return]
[Tab]03  GROUP-A.[Return]
[Tab][Tab]05  ITEM-A[Tab]PIC X(10).[Return]
*[Tab]The tab character in the nonnumeric literal[Return]
*[Tab]on the next line is stored as one character[Return]
[Tab][Tab]05  ITEM-B[Tab]PIC X VALUE IS "[Tab]".[Return]
[Tab]03  ITEM-C[Tab][Tab]PIC X(10).[Return]
\D01[Tab]RECB REDEFINES RECORD-A[Tab]PIC X(21).[Return]

1.4 Sample Entry Format

The following format is used to describe most entries in this manual. Each COBOL division or major topic begins a new chapter and each entry begins on a new page. The entries are in functional or alphabetical order.

Entry-Name

Function
The function paragraph describes the function or the effect of the entry.

General Format
A general format shows the specific arrangement of elements in the entry. If there is more than one arrangement, the formats are numbered. All clauses (mandatory and optional) must be used in the sequence shown in the format. However, the syntax rules sometimes allow exceptions.

generic-term
Following the general format are definitions of its generic terms. These terms appear in the rules in italic type.

Syntax Rules
Syntax rules define or clarify the arrangement of words or elements. They can also impose further restrictions or relax restrictions implied by the general format.

General Rules
General rules define or clarify the meaning (or relationship of meanings) of an element or set of elements. They also define the semantics of an entry, describing its effects on program compilation or execution.

Technical Notes
Technical notes describe, in system-specific terms, any system-specific behavior, and any other HP COBOL behavior of note not described in the rules. They define relationships between the COBOL program and the operating system and its components.

Additional References
Additional references point to other relevant information in this manual, the HP COBOL User Manual, and other Hewlett-Packard documentation sets.

Examples
Examples show the use of a statement, clause, or other entry. The HP COBOL User Manual contains other examples in application contexts.

The following example shows a general format:


Additional References


Previous Next Contents Index