Menu

SET TO not issueing error when working with -std=ibm

2023-07-05
2023-07-05
  • Rune Christensen

    Hi

    When writing the following code, and compiling with -std=ibm, GnuCOBOL does not give any errors.

    01  FILLER                                                 
        03  WS-INTEGER                PIC 9(9).                
        03  WS-LIST PIC 9(9) OCCURS 20 TIMES INDEXED BY WS-IX. 
    
    PROCEDURE DIVISION.                                        
    
        SET WS-IX      TO 1                                    
        SET WS-INTEGER TO 1                                    
    

    But when compiling with IBM COBOL compiler, we receive the following error:

    SEVERE: THE RECEIVING OPERAND "WS-INTEGER" IN THE "SET" STATEMENT WAS AN
     INVALID TYPE.  THE STATEMENT WAS DISCARDED.                            
    

    It it possible to setup GnuCOBOL to return an error, when trying to SET ordinary integer variables?
    Regards
    Rune Christensen

     
  • Chuck Haatvedt

    Chuck Haatvedt - 2023-07-05

    Rune,

    The SET command can NOT be used to assign a value to a numeric field. The SET command is used to change the value of a USAGE INDEX variable or a POINTER variable.

    So you are correct that this should return an error...

    Can you go to the "tickets" section above and create a bug report for this ? Please include a very small program to illustrate the bug...

           Thanks,
    

    Chuck Haatvedt

     

    Last edit: Chuck Haatvedt 2023-07-05

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.