View Full Version : Passing variable number of parameters to RPGLE program
04-13-2006, 05:07 AM
From my interpretation of your request, it sounds like you want to supply the same parameter list, but numerous times. If this is true, why not supply this list of parameters in a file? Or am I completely off base with my interpretation (NOT the 1st time)? Alan
04-13-2006, 05:30 AM
It sounds like you want to pass a mixed list from a command. From the V5R3 CL manual: "A mixed list accepts a set of separately defined values that usually have different meanings, are of different types, and are in a fixed position in the list." The manual explains how to handle this type of parameter list for processing by a CL or HLL pgm. Find this manual at: http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp
04-13-2006, 06:23 AM
Thank you both for your response. You are right Russ, that's what I want. I think I have to pass the complete command parameterstring to the RPGLE programm and then pick out the individual elements. I will look at the manuals for the layout of the commandstring.
04-14-2006, 08:33 AM
The best way I've seen yet to pass an unlimited number of values to a program is by using a subfile as a work area. Program A can fill up the subfile (which is specified as SHARE(*YES) on the OVRDSPF) and then Program B (which has the dspf in the f-specs coded as User controlled) is invoked, opens the display file, includes at least one EXFMT (just to ensure it will compile;just condition it so it will never execute) and then read the SFL records created in Program A without ever needing to display the SFL itself. In terms of passing a complex list of parameters nothing offers more flexibility.
04-14-2006, 10:06 AM
Wow - I did not know this wass possible. Can you post a simple example of this? Alan
05-03-2006, 06:35 PM
If you have to use a subfile to pass parameters (an intelligent idea) I think you must define how many records the subfile has. In that case, why don't you use a Data Structure to pass parameters between two programs? In this case I'm using a data structure with two dimensions: After that, you have in Program B the same DS with all the paramaters you need and you don't need to use a sub-file to pass the parameters. Carlos B <hr width=50 align=left>Code ('http://www.mcpressonline.com/mc/showcode@@.6b36a800/5')
05-03-2006, 06:37 PM
Hello, Does anyone know how to handle the passing of a variable number of parameters(lists) from a CL program. Explanation: I have a command with a complex list (objectname/library, objecttype and member) which can be entered a multiple time. I want to pass this list to a rpgle program to call an api to get information of every object and display this on a screen. If someone could give me an example I would be verry pleased! Thanks
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.