This article identifies different behaviors of "call system" between UNIX environments.
Problem:
call "system" using "ls -la"On one system this works as expected, whereas on another it is necessary to add x"00" to the end of the command-line. For example:
01 WORK-COMMAND.Why is this?
03 COMMAND PIC X(050) VALUE "ls -la" .
03 FILLER PIX X(002) VALUE X" 00" .
procedure division.
CALL "SYSTEM" USING WORK-COMMAND.
Resolution:
This behavior depends on the case used in the CALL statement.
call "system" (all lower-case) calls the OS system utility. This is platform specific, and may give unexpected terminal display results. When you are using the MF function CALL "SYSTEM" (upper-case) you must use x"00" to terminate the command.
Incident Number: 2202924