COBOL

COBOL

COBOL

COBOL is responsible for the efficient, reliable, secure, and unseen day-to-day operations of the world's economy.

 View Only
  • 1.  Reference modified field as input to CONTENT-OF intrinsic function

    Posted 23 hours ago

    This is quite an edge case, but since I ran into it, I figured I'd bring it up.  

    If you attempt to call a user defined function passing an ODO field within a CONTENT-OF function call, and being reference modified, there is an internal compiler error.  I know that's confusing.  See below for an example.

     move string-is-valid(                      
              content-of(string-to-check(pos:1))
              check-opt 'N') to result          

    Here is the definition of the string-to-check data field.

     01  string-to-check.                                   
         05  pic x occurs unbounded depending on strlen.

    And here is the compiler error output.

    CURRENT PHASE: IGYCPGEN                                                                                              
    CURRENT LINE NUMBER: 000139                                                                                          
    REGISTERS 0 - 15:                                                                                                    
    1528B30E 00000084 000C2FA0 00000000         00026DD0 00000000 0000FDEC 0001DA14                                      
    1528E352 00000000 0001DA14 10635BB8         1528B1DC 1528AF20 906358DA 000164DA                                      

    PP 5655-EC6 IBM Enterprise COBOL for z/OS  6.4.0 P240202       STRVALFX  Date 10/02/2025  Time 17:59:30   Page    34 
    LineID  Message code  Message text                                                                                   
                                                                                                                         
    000139  IGYPG5125-U   The compilation was terminated due to a compiler error in phase id:  "IGYCPGEN".               
                                                                                                                         
                                                                                                                         
    000139  IGYPG5201-U   Internal compiler error code "PMAA-00" occurred.                                               

    It's easy enough to work around by giving the "table field" a name and then using subscripting instead of reference modification.  But maybe this can be put on a list of things to look at.

    Thanks.



    ------------------------------
    Frank Swarbrick
    ------------------------------


  • 2.  RE: Reference modified field as input to CONTENT-OF intrinsic function

    Posted 9 hours ago

    Thanks Frank, I've opened an internal defect to track this.



    ------------------------------
    Jeffery Shimoda
    ------------------------------