ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Not able to use CLASS keyword.

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

  • Not able to use CLASS keyword.

    Hi,

    I am new to COBOL.

    Trying to declare CLASS but getting error "CLASS invalid, checking resumed at start of clause.". Could someone please guide. Thank you.

    Code:
    IDENTIFICATION DIVISION.                            
    PROGRAM-ID. CLASSCB.
    
    ENVIRONMENT DIVISION.                               
    CONFIGURATION SECTION.                              
    SPECIAL-NAMES.                                      
        CLASS HEXADECIMAL IS '0' THRU '9', 'A' THRU 'F'.

  • #2
    I modified a test member that I already had to add your CLASS-clause. The CONFIGURATION section then looked like this:
    Code:
    Environment Division.
    
    Configuration Section.
    Source-computer.    IBM-AS400.
    Object-computer.    IBM-AS400.
    Special-names.      System-Shutdown is  shutdown-switch
                            ON status   is  going-down
        CLASS HEXADECIMAL IS '0' THRU '9', 'A' THRU 'F'.
    The member compiles without error on i 6.1.

    Only minor difference that I can think of is that my member starts with a PROCESS APOST compile-option statement. (Equivalent to CRTBNDCBL OPTION(*APOST) parameter.)

    Are there any other errors noted? What version are you running?
    Tom

    There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

    Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

    Comment


    • #3
      Agree with Tom...this compiles properly. We're also running at V6R1 but I don't recall every having a problem with the CLASS statements on prior releases. As Tom indicated, if you do not use APOST as a process option you will typically receive a lot of warnings like this:

      MSGID: LNC0014 SEVERITY: 10 SEQNBR: +072400
      Message . . . . : Delimiter for literal is not correct. Literal accepted.

      If you prefer to not use APOST, then change your single quotes to double-quotes...

      Remember, the delimiter warnings are at Level 10 so your program will usually compile and generate object code

      Comment


      • #4
        Mine is V5R3. That is the cause I think. Thank you guys.

        Comment

        Working...
        X