MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » November 2006

Re: Job behaviour RPGLE vs CLLE



fixed

Jim Wiant wrote:

Thanks a lot for the clarification Barbara.

I want to be clear about FREE - are you referring to /Free (Free Format
RPG)? If so, are you saying that if the call command is within the free
format syntax, it will behave as I expect (i.e. resolving the library
list each call?)


Oops, sorry for the confusion.  No, I mean the FREE opcode in RPG/400:

C          CALL    'PGM001'
C          FREE    'PGM001'
C          CALL    'PGM001'

The ILE RPG behaviour is the same for free-form calls with EXTPGM too. 
You can get around it the same way, by using a variable for EXTPGM, and
using the variable name to call some other program when you want to
re-resolved to your program.

D pgm001        pr          extpgm(pgm001Var)
D   parms ...
D dummy         pr          extpgm(pgm001Var)
D pgm001Var     S      21a
 /free
       pgm001Var = 'DUMMY';
       callp (dummy);
       pgm001Var = 'PGM001';
       callp pgm001 (parms ...);
 /end-free

If you had a subprocedure that handled the first three lines, you could
code 
 /free
       resetPgm001Var ('PGM001');
       callp pgm001 (parms ...);
 /end-free

Or you could have a subprocedure that actually handled the call to
pgm001; it would have the prototypes with the EXTPGMs, and do all the
business with the call to DUMMY.  (This would work fine unless you had
optional parameters.)
 /free
        callp callPgm001 ('PGM001' : parms ...);






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact