× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



You might want to look into procedures and prototypes and *OMITting
parameters.

On Fri, 9 Jul 2004 11:26:20 -0230, dclowe@xxxxxxxxxx said:
> 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
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
> list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
> 
-- 
  
  michaelr_41@xxxxxxxxxxxxxx


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.