32,915 pts.
 Return a value from an AS400 Command
I created a command that will be called in various CL programs. The command does some work and then is supposed to return a value. I can step through the program and see the value is being populated, but the value is not returned to my initial CL program What do I need to do to correct this?

Software/Hardware used:
AS400 V5R4
ASKED: March 16, 2011  6:32 PM
UPDATED: March 17, 2011  6:40 PM
  Help
 Approved Answer - Chosen by CharlieBrowne (Question Asker)

Tom
When I initially created the command, I did not specify RTNVAL(*YES),
Then when testing, I discovered I was not getting my value back in my CL program.
Next step was to use RTNVAL(*YES).
Now I was having problems compiling because of ALLOW(*ALL).
Finally I changed the command creation to RSTVAL(*YES) ALLOW(*BPGM *IPGM)
I think this info will help it all to make more sense.

ANSWERED:  Mar 17, 2011  4:22 PM (GMT)  by CharlieBrowne

 
Other Answers:

I figured it out.
On the CRTCMD I needed to change from ALLOW(*ALL) to ALLOW(*BPGM *IPGM)

Last Wiki Answer Submitted:  March 16, 2011  7:12 pm  by  CharlieBrowne   32,915 pts.
Latest Answer Wiki Contributors:  CharlieBrowne   32,915 pts.
To see other answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

That seems unusual. If the command has RTNVAL(*YES) specified, then it shouldn’t have been possible to create it with ALLOW(*ALL). Is there more to this? I’d be interested in whatever info you can supply.

Tom

 108,300 pts.

 

I haven’t quite figured out the rules for RTNVAL(*YES) and ALLOW( xxx ) particularly for ILE. It seems as if any of *IMOD, *BMOD, *IPGM and *BPGM can work, singularly or in combination… at least, in some tests.

Anyway, thanks for clarification. I wondered if there was something you ran into that illuminated things more, but it makes sense.

Tom

 108,300 pts.