Return a value from an AS400 Command

41380 pts.
Tags:
AS/400 command functions
AS/400 commands
AS400 CLP
V5R4
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • CharlieBrowne
    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.
    41,380 pointsBadges:
    report
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • CharlieBrowne
    [...] 5. There are some great suggestions and words of advice from the community in response to a member looking to back up Windows 7 without purchasing software. 6. CharlieBrowne is on the other side of the forums for once, and received help from TomLiotta on returning a value from an AS/400 command. [...]
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following