Rather than delete a procedure, you could do something like have it log a message that it is being used with a call stack or something so you can fix it.
Then rename the procedure and rename the export. This way you don't have to force a recompile.
so you go from
STRPGMEXP PGMLVL(*CURRENT) LVLCHK(*YES) SIGNATURE('MYSRVPGM sig v1')
EXPORT SYMBOL("CA9804R")
EXPORT SYMBOL("MYNEWSUBPROCEDURE")
ENDPGMEXP
to
STRPGMEXP PGMLVL(*CURRENT) LVLCHK(*YES) SIGNATURE('MYSRVPGM sig v1')
EXPORT SYMBOL("XXX_CA9804R")
EXPORT SYMBOL("MYNEWSUBPROCEDURE")
ENDPGMEXP
This keeps "MYNEWSUBPROCEDURE" in the same slot.
Mark Murphy
Atlas Data Systems
mmurphy@xxxxxxxxxxxxxxx
-----Charles Wilt <charles.wilt@xxxxxxxxx> wrote: -----
To: "RPG programming on the IBM i (AS/400 and iSeries)" <rpg400-l@xxxxxxxxxxxx>
From: Charles Wilt <charles.wilt@xxxxxxxxx>
Date: 05/18/2017 03:56PM
Subject: Re: 2 calls to same program using different parameter lengths
On Thu, May 18, 2017 at 1:30 PM, Rob Berendt <rob@xxxxxxxxx> wrote:
Oh. Now that makes sense. I always added them to the end anyway.
Then you would only have to add an additional signature if you removed
one, or some such thing?
​You can't remove one without breaking every caller....if that's really
want you want to do...you'd do it like so
​
Go from
STRPGMEXP PGMLVL(*CURRENT) LVLCHK(*YES) SIGNATURE('MYSRVPGM sig v1')
EXPORT SYMBOL("CA9804R")
EXPORT SYMBOL("MYNEWSUBPROCEDURE")
ENDPGMEXP
To
STRPGMEXP PGMLVL(*CURRENT) LVLCHK(*YES) SIGNATURE('MYSRVPGM sig v2')
EXPORT SYMBOL("MYNEWSUBPROCEDURE")
ENDPGMEXP
Note the signature change to force a level check exception. If your tried
to use a PGMLVL(*PRV) block here, instead of a level check error at run
time...you'd best case, get some funky exception.​ Worst case, you'd get
no exception but invalid results back from the remaining procedures. As
programs that think they are calling CA9804R() would actually be calling
MYNEWSUBPROCEDURE().
Charles