Vatchy
685 pts. | Jan 30 2008 4:14PM GMT
Three alternative answers:
1) Go back to the System/36 days and use the local data area to pass parameters. They won’t mean anything to any program that doesn’t check for them.
2) Use a data area to pass parameters.
3) Use a data queue to pass the parameters.
Vatchy
685 pts. | Jan 30 2008 4:17PM GMT
For the answers I proposed, I am assuming that you are not using the native AS/400 menu format since it has almost no security. I write all of my menus in CL.
Sloopy
1940 pts. | Jan 31 2008 3:32PM GMT
I have used Bruce Vining’s method before, in situations where a variable number of parameters must be passed.
It is worth pointing out that, although in Bruce’s example code the data parameter variables are length 1, the HLL programs that receive the parameters through the CALL operation can actually declare their parameters as whatever lengh and data type they like.
This is because the parameters are passed by address, and not by value. So you can call Bruce’s program like this:
CALL BRUCEPGM PARM(’MYPGM’ ‘MYDATA’ 0000123′)
Bruce’s program will call MYPGM and pass the parameters ‘MYDATA’ and 0000123 BY ADDRESS. If you looked into Bruce’s program in debug, you would see the value ‘M’ in &P1 and hex 00 in &P2.
In the program MYPGM the parameter list would declare the first parameter as character length 6, and the second parameter as 7 digit packed decimal. Debugging MYPGM would show those parameters contain the correct values.
Of course, you have to be careful with this. If you declared the first parameter in MYPGM as character length 7, the value in it would (probably) be ‘MYDATA?’, where ? = hex 00 - it is actually seeing the first character of the next parameter value. So, padding of character values and correct lengths of numerics is required with this method.
So, using Bruce’s program, you can pass different types and lengths of parameter values whenever you call it, depending on which HLL program will be called by it.
John Blenkinsop
NSRI London






