CALL SYSTEM USING WS-COMMAND not working on microfocus COBOL on Enterprise server

815 Views Asked by At

I have a requirement to call a powershell script from microfocus COBOL running on Enterprise server.

The sample script is below:

echo "Hello World " | Out-File -FilePath           
 "C:\test.txt"

I have added the powershell to be executed from batch script as below:

powershell.exe "C:\cbtest.ps1"

The structure of WS-COMMAND is as below:

01 WS-COMMAND.
   05 COMMAND        PIC X(50) VALUE 
       "/c C:\test.bat".
   05 NULL-VALUE     PIC X VALUE X'00.

But, when I am triggering the COBOL prog from a job on microfocus server, a small command prompt window is appearing for some milliseconds, but nothing is happening.

Please let me know what I am doing wrong.

1

There are 1 best solutions below

1
On

Try changing

PIC X VALUE X'00.

To

PIC X VALUE X'00'.