× 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 22-Dec-2011 15:01 , James Lampert wrote:
Given a program that, depending on circumstances, may or may not
call anything in a given service program to which it is linked,
is it possible to defer checking for the existence of the service
program until a call is made to it?

Deferred activation I think does that; specification is possible for "the activation mode for a service program as either immediate or deferred". Refer to the BNDSRVPGM parameter on one of several commands; e.g. CRTPGM:

Element 2: Activation

*IMMED Activation of the bound service program takes place immediately when the program being created is activated.

*DEFER Activation of the bound service program may be deferred until a function it exports is called.

_Activation_
http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/topic/ilec/sc41560642.htm#activa
"
By default, service programs are immediately activated during the call to a program that directly or indirectly requires their services. You can request deferred activation for a service program when you are binding an ILE program or a service program that is created for V6R1, or later. If you request deferred activation for a service program, the activation of a service program can be deferred until one of its imported procedures is called. To minimize activation costs both at program startup and throughout program execution, it is suggested that you specify deferred activation for the service programs that satisfy procedure imports and that are used only on infrequently traveled code paths.
Notes:

1. If you request deferred activation for a service program that satisfies a data import, partial immediate activation is required to initialize the static data.
2. If you request deferred activation for a service program that satisfies a procedure import for a procedure pointer call, partial immediate activation is required to provide the binding for the procedure pointer call.
"

_Create Program (CRTPGM)_
http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/topic/cl/crtpgm.htm
"
Bind service program (BNDSRVPGM)

Specifies the list of service program exports to examine at bind time to ensure they satisfy any module import requests. <<SNIP>>

You can control the activation of each service program. You can specify whether the referenced service program is activated at the same time as the program program being created, or is deferred until a procedure exported from the referenced service program is called. Deferring activation may improve your application's performance.
"

Additionally, if they are defined as external functions [or external procedures], then they can be invoked as a UDF [or CALL] via the SQL without ever binding them. The existence is determined at run-time, but for both the routine catalog entry and the external program to which the routine refers. AFaIK a procedure which is merely declared within embedded SQL [DECLARE PROCEDURE] can not refer to a Service Program; i.e. the actual CREATE of the routine, either CREATE PROCEDURE or CREATE FUNCTION would be required.

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.