Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rexx returns rc as -1 always

Status
Not open for further replies.

RajeshwariIyappan

Programmer
Jan 12, 2016
1
IN
Hi,

I have a rexx program that calls shell commands using "address cat filename".
This program returns rc as -1 when invoked from GI. But when the same rexx is invoked from linux command line rc is 0. The rc value is -1 irrespective of any shell command executed and called from GI right click. I doubt whether there will be any .profile that needs to be run in GI that is causing the issue. Please give your comments for the problem.
 
Which rexx interpreter are you using? Who supplies the 'cat' address space? What is 'GI'?


Nic
 
Of course, if 'cat' is the *nix concatenate command then your ADDRESS statement is coded wrongly - you have not provided the environment to which the command is to be sent. The syntax should be ADDRESS env command-string. However, if you are sending the command to the operating system you do not need to use the ADDRESS keyword - simply put the command string in quotes. Rexx recognises that it is not a Rexx construct so passes it on to the calling environment.

So..
method 1
ADDRESS CMD "cat fiename"​

method 2
"cat filename"​

Read up on ADDRESS.


Nic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top