Skip to main content

hello

we are migratiing from cob 5.1.4.0 to visual cobol V6.0.0.108 on AIX 7.2 server.

we have some programs who apply a item ANY LENGTH in the linkage section and a "SET ADRESS OF item TO pointer" in the PROCEDURE DIVISION.

On AIX serveur, compile with cob 5.1.4.0 work well, but we got an several error COBCH1886 when compile with Visual cobol V6.

Is there any patch to apply ?

ERRORS: 

* Window Syntax precompiler (V3.2 Ref:1.43)
3667 SET ADDRESS OF LI-TMP TO W-POINTER
*1886-S******************************** ( 0)**
** Invalid use of ANY LENGTH item
cob64: error(s) in compilation: COPOS-VISU.CBL


#VisualCOBOL
#COBCH1886

hello

we are migratiing from cob 5.1.4.0 to visual cobol V6.0.0.108 on AIX 7.2 server.

we have some programs who apply a item ANY LENGTH in the linkage section and a "SET ADRESS OF item TO pointer" in the PROCEDURE DIVISION.

On AIX serveur, compile with cob 5.1.4.0 work well, but we got an several error COBCH1886 when compile with Visual cobol V6.

Is there any patch to apply ?

ERRORS: 

* Window Syntax precompiler (V3.2 Ref:1.43)
3667 SET ADDRESS OF LI-TMP TO W-POINTER
*1886-S******************************** ( 0)**
** Invalid use of ANY LENGTH item
cob64: error(s) in compilation: COPOS-VISU.CBL


#VisualCOBOL
#COBCH1886

Hi Jeremy,

The full text of this error message states that what you are trying to do is invalid so I am not sure why it wasn't flagged as an error in V5.0.

COBCH1886 Invalid use of ANY LENGTH item

An item defined with the ANY LENGTH clause has been used incorrectly within the Procedure Division.

This occurs when such an item is given addressability via a SET ADDRESS OF statement. Refer to The ANY LENGTH Clause for more information on its usage.

-----------------------

According to the documentation ANY LENGTH should only be used when the data-item is being passed as a parameter and appears in the procedure division using header.

       working-storage section.
       01 field-1 pic x(5) value "ABCDE".
       01 field-2 pic x(10) value "1234567890".
       procedure division.

           call "subprog" using field-1
           call "subprog" using field-2
           goback.
        
        subprog
        
        identification division.
        program-id. subprog.
        linkage section.
        01 param-1  pic x any length.
        procedure division using param-1.

           display param-1
           display length of param-1
           goback.