COBOL Manual for TNS/E Programs (H06.03+)
Data Fundamentals
HP COBOL Manual for TNS/E Programs—520347-003
4-3
Records
Records
A record is a sequence of character positions. It can be an elementary data item or a
data structure. Its data description entry determines its internal structure (see
PICTURE Clause). Records can be of fixed length or variable length. COBOL
programs manipulate logical records and physical records.
Most of the data in a typical COBOL program is in records. When a program reads
data from or writes data to a file, the unit of transmission is the record.
Example 4-1. Level Numbers
FD BRANCH-OFFICE-FILE
LABEL RECORDS ARE OMITTED
RECORD CONTAINS 100 CHARACTERS
DATA RECORDS ARE ADDRESS-RECORD,
PERSONNEL-RECORD, MISC-RECORD.
* A record follows.
01 ADDRESS-RECORD.
* A data structure follows.
05 OFFICE-NUMBER.
* An elementary item follows.
10 DISTRICT PICTURE 99.
* Condition-names follow.
88 NEW-YORK VALUE 21.
88 TAMPA VALUE 43.
88 OMAHA VALUE 55.
...
10 REGION PICTURE 999.
05 OFFICE-ADDRESS.
10 STREET PICTURE X(25).
10 CITY PICTURE X(15).
10 STATE PICTURE X(2).
10 ZIP-CODE PICTURE 9(9).
...
* A record follows.
01 PERSONNEL-RECORD.
05 OFFICE-MANAGER PICTURE X(35).
05 NO-OF-EMPLOYEES PICTURE 9(4).
05 TAX-GROUPS.
10 HOURLY.
15 PART-TIME PICTURE 99.
15 FULL-TIME PICTURE 99.
10 EXEMPT PICTURE 9(4).
...
01 MISC-RECORD.
...










