Truusvlugindewind
Programmer
Hi, Using Server Express 2.0.11 on a AiX 4.3.3. box I am looking for a way to obtain the PID of a running cobol program at execution time.
As this information can be retrieved in unix by the command "echo $$", I've tried the following code:
display "$$" upon environment-name
accept WS-pid from environment-value
display " pid " WS-pid
No go: the field WS-pid remains blank.
I know I can obtain like this: "call 'SYSTEM' using 'echo $$ >> /tmp/answer.txt' ".
In my case I want to use the PID info to compose an unique name for the dataset containing the result
(/tmp/$$.txt instead of /tmp/answer.txt).
But how do I know the filename in cobol to open to read the answer?
Or are there other ways to trap STDOUT from a call to 'SYSTEM'?
As this information can be retrieved in unix by the command "echo $$", I've tried the following code:
display "$$" upon environment-name
accept WS-pid from environment-value
display " pid " WS-pid
No go: the field WS-pid remains blank.
I know I can obtain like this: "call 'SYSTEM' using 'echo $$ >> /tmp/answer.txt' ".
In my case I want to use the PID info to compose an unique name for the dataset containing the result
(/tmp/$$.txt instead of /tmp/answer.txt).
But how do I know the filename in cobol to open to read the answer?
Or are there other ways to trap STDOUT from a call to 'SYSTEM'?