|
When I was designing/programming an order entry system I had the same
challenge. What I did as define all lookups with the same parameter
list. For all lookups, I call a single program that determined which
program to call and put that name in a field. Using that field as the
program name, I called the lookup program. Then when the user selected
the record in the lookup subfile, I put that record into the *LDA and
returned to the caller. I would move the *LDA into a data structure of
that record time. Now you have the complete lookup record.
Marvin
date: Fri, 9 Jul 2004 11:26:20 -0230
from: dclowe@xxxxxxxxxx
subject: Build PLIST at runtime
Hi, I don't know if this can be done or not but I'm going to have a
crack
at it.
I'm trying to create a program that calls other programs based on the
program name and parameters that are determined at runtime. My first
attempt has not been too successful, I have two RPG programs: CALLER and
CALLEE. Here is the source:
Program CALLER:
d in s *
d f00007s02 s 7s 2
d f00007s02p s *
c
c eval f00007s02 = 100
c eval f00007s02p = %addr(f00007s02)
c eval in = f00007s02p
C call 'CALLEE'
C parm pn 10
C parm in
c parm 0 out 11 2
c eval *inlr = *on
Program CALLEE
C *entry plist
C parm part 20
C parm inqty 7 2
C parm outqty 11 2
c eval outqty = inqty * 2
c eval *inlr = *on
I would have expected that the INQTY field in CALLEE would have been
populated with the value 100 which I assigned to it in the CALLER
program.
The program runs and bombs in CALLEE with decimal data error. Now, why
am I trying to do this? Well I want to call my lookup programs in a
generic fashion from a single program but I don't want to have a huge
select statement saying when the program is CALLEE use this Plist and so
on, I want to pass in the name of the program and what it's parameter
types and values are and call the program. (I will also want to
retreive
the program's updated variables when I get back to CALLER).
Does this make sense, do you think it can even be done? TIA for your
help.
Dean Clowe
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.