Page 1 of 1
Can Atrium menu option include a parm with program call?
Posted: Thu Oct 30, 2014 3:50 pm
by ppbedz
I am setting up a menu option in Atrium and would like to pass a parameter to the program it is calling. I tried to set it up as follows and it does not seem to pass anything even though the program still executes. Is this syntax even valid, or is there another way to pass a parm? Thank you.
Re: Can Atrium menu option include a parm with program call
Posted: Thu Oct 30, 2014 3:54 pm
by Scott Klement
That syntax is not valid. That field is for the program name, so in your example, it thinks that you have a progam named "reqshtc2t parm('MNT')". It thinks the whole string is part of the program name -- but since a program name can't be longer than 10 characters -- and by chance, the 'parm' starts in the 11th character, so it gets "chopped off".
If you update to the latest version of Atrium, there is a separate field for a parameter that will be passed to the program.
Re: Can Atrium menu option include a parm with program call
Posted: Thu Oct 30, 2014 4:04 pm
by ppbedz
Thanks Scott....that will be very useful!
Re: Can Atrium menu option include a parm with program call
Posted: Thu Nov 06, 2014 11:56 am
by Gerd
Hello Scott,
that is very helpful.
But what shall i do if i need more than one parm-value?
Re: Can Atrium menu option include a parm with program call
Posted: Thu Nov 06, 2014 12:42 pm
by Scott Klement
Atrium currently supports only one parameter. However, it's a rather large parameter (up to 250 characters) so you could potentially put multiple values in that parameter if you need to.
For example, you could have a CL program like this:
Code: Select all
PGM PARM(&BIGPARM)
DCL VAR(&PARM1) TYPE(*CHAR) LEN(10)
DCL VAR(&PARM2) TYPE(*CHAR) LEN(10)
DCL VAR(&BIGPARM) TYPE(*CHAR) LEN(250)
CHGVAR VAR(&PARM1) VALUE(%SST(&BIGPARM 1 10))
CHGVAR VAR(&PARM2) VALUE(%SST(&BIGPARM 11 20))
CALL MYPGM PARM(&PARM1 &PARM2)
So this would allow you to pass data from Atrium all in one big parameter, and then split it up into multiple parameters when calling your RPG program. Does that help you at all?
Re: Can Atrium menu option include a parm with program call
Posted: Tue Nov 11, 2014 6:12 am
by Gerd
Hi Scott,
thank you, this workaround will help.