Absent Member.
Absent Member.
768 views

Calling SYSTEM

Hi, 

In MF COBOL + Unix Environment , we used Call SYSTEM to execute Unix Commands from COBOL program.( Mostly used to move files )

In Visual COBOL on Windows ( Oracle DataBase and Powershell scripts ) , how will i execute above commands by using Call SYSTEM.

string 'move ' delimited by size 'D:\DataFiles\*'  delimited by size 'D:\OutDataFiles' delimited by size X"00" delimited by size

           into WS-SHELL-CMD
end-string.

call 'system' using WS-SHELL-CMD.

We will be using Windows command prompt commands to execute instead of Unix commands ?

Please advise if there is something incorrect or missing.

0 Likes
1 Reply
Micro Focus Expert
Micro Focus Expert

The call "system" is supported under Windows in the same manner as under Unix so the above command should work just fine.

If you wish to suppress the prompt o overwrite existing files then you can add the "/Y" switch to the move command.

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.