Executing scripts from VS under AIX

[Migrated content. Thread originally posted on 26 January 2012]

Hello,

I am trying to execute this command:
Dialog.win \\0040 12614401
Under RM/COBOL it works without problems. As you can see, there are two parameters.

I am doing the CALL like this:
call visualcobolcall "system" using fp-mandato
And the following error appears:
sh: \0040:  not found                                                         |                                                                                                                                                                               
                      sh: 12614401:  not found

It seems that Visual COBOL is interpreting that there are three separate commands...
  • Can you please try a test for me?
    Can you change the call to the following and tell me if you get the same results:

    call visualcobolcall "SYSTEM" using z"echo \\0040 12614401"

    On our test system it correctly displayed:

    \0040 12614401

    Thanks.
  • Seems to work
                                                                                                                                                                                                                                                                   
      12614401                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                                                       

    This also works:
               move z"echo \\0040 12614401" to mandato.
               call visualcobolcall "SYSTEM" using mandato.

    And this:
               move spaces to mandato.
               string "echo "           delimited by size
                      "\\0040 "         delimited by size
                      z"12614401"       delimited by size
                         into mandato
               end-string.
               call visualcobolcall "SYSTEM" using mandato.

    Also this:
               move "12614401" to token.
               move spaces to mandato.
               string "echo "     delimited by size
                      "\\0040 "   delimited by size
                      token      delimited by space
                      z""         delimited by size
                         into mandato
               end-string.
               call visualcobolcall "SYSTEM" using mandato.

    A bit tricky, isn't it?
  • I also observed that these call "system" are asynchronous:
    VC         call-convention 0 is VisualCOBOLcall
    VC            call visualcobolcall "system" using fp-mandato

    I suppose you can use 0 or any other number, but I am not sure about the consequences, so I have been looking for this clausule at the documentation, but haven't found anything.

    PS: I know that are asynchronous because I am versioning a program that runs with RM/COBOL and executes a unix script which uses a windows dialog written in a particular language provided by our terminal emulator. This windows is modal, but Visual COBOL launchs the script and the COBOL program keeps on running, avoiding me to capture any data returned from the dialog. This is the sequence I am trying to reproduce:

    1. COBOL program launches Dialog.win and waits.
    2. Dialog.win opens a new window dialog and enables the user to enter some data.
    3. When Dialog.win ends, COBOL takes control again and recovers data using an ACCEPT.
  • Verified Answer

    Please create a Support Incident with your local Micro Focus Supportline office as this appears as though it may be a bug and we need to RPI it.

    The call-convention 0 should have nothing to do with the call being asynchronous as this just tells the compiler to generate a standard call for this statement so it is the call to SYSTEM itself that may have the problem.

    We did find a similar problem with the CBL_EXEC_RUN_UNIT earlier and the two may be related.

    Thanks.