A little bit generic, as a starting point, isn' t it ?
If You want to behelped You need to be a little bit more specific.
is the program You a recalling REXX aware?
if not You can only have collateral effecs,
which means carry on some actions based on the input parameters,
the only thing which will passed back and usable by rexx is the return code.