ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

screen section error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • screen section error

    i'm having a problem in my screen section in COBOL. the error is redundant clause ignored and i really don't know how to fix it! helpp

    here's part of the code:

    01 SCREEN-1.
    02 BLANK SCREEN.
    02 LINE 4 COLUMN 30 VALUE 'WELCOME'.
    02 LINE 5 COLUMN 25 VALUE '======================================'.
    02 LINE 6 COLUMN 25 VALUE 'What is your name?'.
    02 LINE 6 COLUMN 50 PIC X(30) TO NAME.

    02 LINE 7 COLUMN 30 VALUE 'What is your gender (M/F)?'.
    02 LINE 7 COLUMN 50 PIC X TO GENDER.
    02 LINE 8 COLUMN 30 VALUE 'Single or married (S/M)?'.
    02 LINE 8 COLUMN 50 PIC X TO STAT.
    02 LINE 9 COLUMN 30 VALUE '======================================'.

    there's always an error on the fifth line and i really don't know what's wrong.

  • #2
    Re: screen section error

    Hi

    Just have a close look at the line that you getting the eror on and the line below it:

    02 LINE 6 COLUMN 25 VALUE 'What is your name?'.
    02 LINE 6 COLUMN 50 PIC X(30) TO NAME.

    So starting at column 25, and plus another 18-chars for ('What is your name?') makesa total of 43. Then starting at column 50 plus another 30-chars for field NAME it goes to 50 + 30 = 80, but we only allowed to code till column 72 in Cobol, so try and adjust so that it does NOT exceed that 72-column limit.

    Let mw know what the results are.

    Reards.
    IQ138

    Comment

    Working...
    X