Ch 3_0. COBOL Data Elements
FILE
The collection of records in an application area such as Payroll,
Billing, Grading, etc.
RECORD
Each RECORD consists of FIELDs pertaining to a specific item, such as
Employ, Student, Customer, etc.
Field
Each field defines a group of consecutive characters such as Name, Amt,
Score, etc.
Naming Rules for FILE, RECORD, PARAGRAPH and DATA NAMES
- 1-30 characters
- Letter, digits, and hyphens only
- No embedded blanks
- Must contain an alpha chracter
- No COBOL reserved words
- Not begin or end with hyphen
Guidelines for forming Names
- Use hyphens as separators, (e.g. DATE-OF-BIRTH)
- Use meaningful names: AMT-OF-PURCHASE
- Use prefixes and suffixes: MONEY-IN, MONEY-OUT
PAYROLL-FILE, IN-REC, MAIN-PARA.