## Calling script from RM cobol and returning value to cobol

Calling script from RM cobol and returning value to cobol
# 1
Calling script from RM cobol and returning value to cobol

Is there a way you can return a value from a script that is called from a rm cobol program...
01 WS-COMD-LINE-PGM X(39) value sh ./getUserId.sh 12345"
01 WS-RETURN-SYS-CODE PIC 9(8).

CALL "SYSTEM" USING WS-COMD-LINE-PGM
GIVING WS-RETURN-SYS-CODE.

WS-RETURN-SYS-CODE will return a numeric success / failure indicator.

My script returns values using exit command as below: (suggestion to improve the script will also help) -

#getUserId.sh - Get user from /etc/passwd using PID passed from cobol program.
processid=$1 echo$processid
if test -f pslog
then \rm pslog
fi
ps -ef -o "%u: %p" | grep $processid > pslog cat pslog puser_id="$(cut -d: -f1 < pslog)"
echo "User Name=" $puser_id; puser_name="$(cut -f 1,5 -d : /etc/passwd | grep $puser_id)" echo$puser_name

## COBOL issue

Hi, I am working on a Mainframe to UNIX replatforming project. we are facing problems with COBOL COMP-3 fields. We are using the Mainframe emulator software to download the data which has COMP-3 fields and using it as input to the same COBOL programs which were copied from Mainframe and did the...

## COBOL on linux?!

Hello guys, I'm searching for a good COBOL compiler which runs on linux. In fact I have found one but I'm really lost with its installation!! I don't know how to install it and how it works. In fact I'm not so good in linux and I always have problems with installation, but this time it's...

## Cobol On Unix

Hi , Could anyone please tell me about the whole procedure for compiling, linking the cobol program on unix platform. As i am mainframe guy and very new to unix, any help will be very appriciated, Regards, -Vinit