HP OpenVMS Systems Documentation

Content starts here

Reference Manual

Previous Contents Index

1.2 Character Strings

A character-string is a character or a sequence of contiguous characters that form a COBOL word, a literal, a PICTURE character-string, or a comment-entry. Separators delimit character-strings. The following sections describe these topics in detail.

1.2.1 COBOL Words

A COBOL word is a character-string of not more than 31 characters that forms one of the following:

  • A user-defined word
  • A system-name
  • A reserved word
  • A function-name

A user-defined word or system-name cannot be a reserved word. However, a program can use the same COBOL word as both a user-defined word and a system-name. The compiler determines the word's class from its context. User-Defined Words

A user-defined word is a COBOL word that you must supply to satisfy the format of a clause or statement. This word consists of characters selected from the set A to Z, 0 to 9, the currency sign ($), underline (_), and hyphen (-). Throughout this manual, and except where specific rules apply, the hyphen (-) and the underline (_) are treated as the same character in a user-defined word. The underline (_), however, can begin or end a user-defined word, and the hyphen (-) cannot. By convention, names containing a currency sign ($) are reserved for Hewlett-Packard.

Table 1-2 provides brief descriptions of the COBOL user-defined words.

Table 1-2 COBOL User-Defined Words
User-Defined Word Purpose
Alphabet-Name Assigns a name to a character set, collating sequence, or both. Alphabet-names must be defined in the SPECIAL-NAMES paragraph. (See Section 4.1.3 in Chapter 4, Environment Division.)
Class-Name Relates a name to a specified set of characters listed in that clause. (See Section 4.1.3 in Chapter 4, Environment Division.)
Condition-Name Assigns a name to a value, set of values, or range of values in the complete set of values that a data item can have. Data items with one or more associated condition-names are called conditional variables.

Data Division entries define condition-names. Names assigned in the SPECIAL-NAMES paragraph to the "on" or "off" status of switches are also condition-names.

Data-Name Names a data item described in a data description entry. When specified in a general format, data-name cannot be reference modified, subscripted, indexed, or qualified unless specifically allowed by the rules for that format.
File-Name Names a file connector. A file connector is a storage area that contains information about a file and is the link between:
  • A file-name and a physical file
  • A file-name and its associated storage area

File description entries and sort-merge file description entries describe file connectors.

Index-Name Names an index associated with a specific table.
Level-Number Is a one- or two-digit number that describes a data item's special properties or its position in the structure of a record. (See Sections 5.1.1 and 5.1.2.)
Library-Name Names a COBOL library used in a source program compilation. (See the Section 8.1.1 statement in Chapter 8.)
Mnemonic-Name Associates a name with a system-name, such as CONSOLE, SYSERR, ARGUMENT-NUMBER, ENVIRONMENT-NAME, C01, OR SWITCH-8. (See Section 4.1.3 in Chapter 4.)
Paragraph-Name Names a Procedure Division paragraph. (See Section 2.1.3.) Paragraph-names are equivalent only if they are identical; that is, if they are composed of the same sequence and number of digits and/or characters.

For example:

Start-up START-UP Equivalent
001-START-UP 01-START-UP Different
017 017 Equivalent
017 17 Different
Program-Name Identifies a COBOL source program. (See the Section 3.1.1 paragraph in Chapter 3, and the section on Section 6.8.4 in Chapter 6, for a description of case-sensitivity on the Tru64 UNIX operating system. Also refer to the HP COBOL User Manual for a description of the -names lowercase , -names uppercase , and -names as_is flags.)
Record-Name Names a data item described with level-number 01 or 77.
Report-Name Names a report produced by the Report Writer Control System (RWCS). (See the Section 5.3.42 clause in Chapter 5.)
Screen-Name (Alpha, I64) Names a screen item defined in the SCREEN SECTION of a program. (See the Section 5.3.6 section of Chapter 5.)<>
Section-Name Names a Procedure Division section. Section-names are equivalent only if they are identical; that is, when they are composed of the same sequence and number of digits and/or characters. (See Section 2.1.2.)
Segmented-Key-Name Identifies a segmented key, which is a concatenation of one or more (up to eight) data items (segments) within a record associated with an indexed file. A segmented key is a form of primary or alternate key. It offers flexibility in defining record description entries for indexed files. (Refer to the section on segmented keys in the HP COBOL User Manual.)
Segment-Number Is a 1- or 2-digit number that classifies a Procedure Division section for segmentation. In HP COBOL programs, segment-numbers specify independent and fixed segments. (See Section 6.7.)
Symbolic-Character Identifies a user-defined figurative constant.
Text-Name Identifies library text in a COBOL library. (See the Section 8.1.1 statement in Chapter 8.)

Within a given program, but excluding any contained program, the user-defined words are grouped into the following disjoint sets:

condition-names, data-names, and record-names

All user-defined words in a program, except segment-numbers and level-numbers, can belong to only one of these sets. User-defined words in each set must be unique, except as described in the rules for uniqueness of reference. (See Section 6.2).

Except for section-names, paragraph-names, segment numbers, and level-numbers, all user-defined words must contain at least one alphabetic character. Segment-numbers and level-numbers need not be unique. Any segment-number or level-number can be the same as any other segment-number or level-number.

Previous Next Contents Index