Highlighted
Absent Member.
Absent Member.
1636 views

Executing scripts from VS under AIX

Jump to solution

[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...
0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Executing scripts from VS under AIX

Jump to solution
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.

View solution in original post

0 Likes
5 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Executing scripts from VS under AIX

Jump to solution
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.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Executing scripts from VS under AIX

Jump to solution
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?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Executing scripts from VS under AIX

Jump to solution
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.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Executing scripts from VS under AIX

Jump to solution
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.

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Executing scripts from VS under AIX

Jump to solution
Ok, thank you.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.