Highlighted
Respected Contributor.
Respected Contributor.
691 views

DataRep2.cbl

I noticed an issue with the level numbers in DataRep2.cbl referenced in the "04 Data Representation" section of the Academic COBOL Course Book for Visual Studio.

The way it is coded, EMPLOYEE-GENDER and the fields following would be grouped in EMPLOYEE-NAME.

0 Likes
1 Reply
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: DataRep2.cbl

Hi Mike,

You are correct. I will pass this onto the author of the course.

Thanks.

DataRep2.cbl contains the following:

01  EMPLOYEE-RECORD.
          03  EMPLOYEE-NAME.
              05  EMPLOYEE-TITLE          PIC X(3).
              05  EMPLOYEE-INITIALS       PIC X(4).
              05  EMPLOYEE-SURNAME        PIC X(30).
          05  EMPLOYEE-GENDER             PIC X.
          05  EMPLOYEE-ADDRESS.
              07  EMPLOYEE-ADDRESS-LINE   PIC X(30) OCCURS 4.
          05  EMPLOYEE-POSTAL-CODE        PIC X(8).
          05  EMPLOYEE-SALARY             PIC 9(5)V99.

and it should be:

01  EMPLOYEE-RECORD.
           03  EMPLOYEE-NAME.
               05  EMPLOYEE-TITLE          PIC X(3).
               05  EMPLOYEE-INITIALS       PIC X(4).
               05  EMPLOYEE-SURNAME        PIC X(30).
           03  EMPLOYEE-GENDER             PIC X.
           03  EMPLOYEE-ADDRESS.
               05  EMPLOYEE-ADDRESS-LINE   PIC X(30) OCCURS 4.
           03  EMPLOYEE-POSTAL-CODE        PIC X(8).
           03  EMPLOYEE-SALARY             PIC 9(5)V99.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.