Define a customer record
Create a group item a customer record with the following fields:
- Customer ID (5 digits)
- Name (30 characters)
- Age (2 digits)
- Balance (up to 99999.99)
Use VALUE clause to initialize fields
Declare working-storage variables for:
- A default username
- A login status flag (Y/N)
Use REDEFINES for format switching
Define an 8-character date field (e.g., 20250517
)
Use REDEFINES
to split it into:
- YEAR (4 characters)
- MONTH (2 characters)
- DAY (2 characters)
Use 88-level condition names
Create a status flag with values Y
or N
.
Define 88-level condition names to represent YES
and NO
.
Use them in a conditional statement.
Use RENAMES to group fields
Define a name structure with:
- FIRST-NAME
- MIDDLE-NAME
- LAST-NAME
UseRENAMES
to create a new group item for full name (excluding middle name).
Declare FILLER fields
Define a record layout that includes unused/reserved space using FILLER
.
Group vs Elementary Items
Create a group item ADDRESS
with:
- STREET
- CITY
- PIN-CODE
Identify group and elementary items based on the structure.
Define record for writing to a file
Create a data structure for an EMPLOYEE-RECORD
with:
- Name (20 chars)
- Department Code (3 chars)
- Salary (up to 99999.99)