Migration from RM/COBOL: some problems

[Migrated content. Thread originally posted on 21 December 2011]


I have more problems with the migrating to VisualCobol of RMCOBOL programs... I wanted to know if there is some kind of solution for these problems, or if it will be corrected in future VisualCobol versions

1)In some programs RM / COBOL, we use the word PROGRAM-ID to know the name of the current program ..

       PROGRAM-ID.   BASE0006.

But in Visual Cobol it gives the error "invalid operand"...

2) In Visual Cobol this line of code doesn't work

We have to change it with
... ((WENTRADA(1:1) = “S”) OR (WENTRADA(1:1) = “s”))..

Is there another option that does not force me to modify the code?

3)The next RM/Cobol rutines doesn't work with Visual Cobol:


Is there any way to get the information you give us back these routines?
Will it be available in future VisualCobol versions?

Thanks in advance

  • Verified Answer

    The RM compatible library routines that have been implemented in Visual COBOL are documented here:

    Visual COBOL has its own set of Library routines that can be found documented here:

    An example of how to return program information about the current program and other program in the run-unit is as follows: (please see entry for CBL_GET_PROGRAM_INFO for more detailed information)

           program-id. testProgram.
           data division.
           working-storage section.
           01 wsfunction              pic x(4) comp-5.
           01 param-block.
              05 cblte-gpi-size      pic x(4) comp-5.
              05 cblte-gpi-flags     pic x(4) comp-5.
              05 cblte-gpi-handle    usage pointer.
              05 cblte-gpi-prog-id   usage pointer.
              05 cblte-gpi-attrs     pic x(4) comp-5.
           01 return-buf             pic x(100).
           01 return-buf-len         pic x(4) comp-5 value 100.
           01 status-code     pic x(4) comp-5 value 0.
           procedure division.

               move length of param-block to cblte-gpi-size
               move length of return-buf to return-buf-len
             *> Establish the current program and return handle           
               move 0 to wsfunction
               perform 100-call-program-info
               display "program name = " return-buf
             *> Get first entry point in program
               move 4 to wsfunction
               perform 100-call-program-info
               display "entry point = " return-buf
             *> Close the handle that was established
               move 6 to wsfunction
               perform 100-call-program-info
               stop run.
               call "CBL_GET_PROGRAM_INFO"
                     by value wsfunction
                     by reference   param-block
                     by reference   return-buf
                     by reference   return-buf-len
                 returning      status-code

    The UPPER-CASE intrinsic function can be used instead of the CASE-INSENSITIVE of RM