× 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.



On 2021-09-03 9:33 a.m., Greg Wilburn wrote:
Without getting into the details... I made a mistake adding a procedure to a service program. I need to remove it.

This SRVPGM is used all over the place.

Can I simply remove it, recompile the module and then UPDSRVPGM?



I'm assuming you used binder source to create your service program.

If the unwanted procedure is the last entry in the binder source, you can remove it from the module and the binder source and rebuild the service program. Anything program that was actually calling that procedure will fail when it's called because the export is missing, so you'll be able to detect the problem.

If it's not the last entry in the binder source, you can't just remove it from the binder source, since that will break the calls to any of the procedures below it in the binder source. (Once the service program has been bound to the program, the calls are by export number, not by name.)

You could add another exported procedure to your module, say DUMMY1 and change the EXPORT for your unwanted procedure to be DUMMY1.

If you think something might be calling the unwanted procedure and you don't want that, make DUMMY1 crash somehow, so you'll find out about the illegal calls.

So just to give an example:

Say you had proc1, proc2, and proc3 before, and now you don't want proc2 now.

Your binder source before:
EXPORT(proc1)
EXPORT(proc2)
EXPORT(proc3)

Your changed binder after:
EXPORT(proc1)
EXPORT(DUMMY1) /* proc2 was removed from here */
EXPORT(proc3)

DUMMY1:

// - This procedure is used to replace proc2
// in srvpgm x.
// - It has a deliberate error, in case anything was
// actually calling proc2
dcl-proc dummy1 export;
dcl-s x int(10);
dsply 'deliberate error, illegal call to proc2';
x = 1 / x; // divide by zero
end-proc;

(A better version of DUMMY would send an escape message to its caller)


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.