Re: Stored procedure calling sub-programs : Sqlcode -927
December 22, 2001 05:08 AM
(in response to Tim Lowe)
As Tim implies (but somehow doesn't actually say) some people
handle this by copying DSNALI (DSNRLI for WLM SPASs) into a
library at the front of STEPLIB, and giving it aliases of DSNHLI
DSNWLI (don't forget that the module is also used for IFI
That way, in the SPAS, dynamic calls to DSNHLI are resolved
using entry points in DSNALI and using DSNELI in other address
For CICS, my understanding is that the question is moot. DSNCLI
_must_ be statically linked into the load module.
To be pedantic, ATTACH(CAF) will generate a call to DSNHLI2 -
which is an alternative entry point in DSNALI. The DSNALI entry
point itself, is used to manage the connection to DB2.
On 21 Dec 2001, at 10:11, [login to unmask email] wrote:
Date sent: Fri, 21 Dec 2001 10:11:01 -0600
Send reply to: DB2 Data Base Discussion List
<[login to unmask email]>
From: [login to unmask email]
Subject: Re: [DB2-L] Stored procedure calling sub-programs :
To: [login to unmask email]
> You did not address your message to me, but I should mention
> second option will not work unless you also use the DB2
> ATTACH(CAF). If you compile your program with DYNAM, then it
> matter what you linkedit with it, it will dynamically call it,
> the attach routine that you included in the linkedit. And,
> have also specified ATTACH(CAF), your dynamic call will be to
> DSNHLI, which is an alias to DSNELI, the DB2 TSO attach, and
you will get
> -927. By using ATTACH(CAF), the code generated by the
precompiler will be
> a call to DSNALI instead of DSNHLI.
> Without any precompiler options, the DB2 calls become calls to
> DSNHLI. With ATTACH(CAF), they are calls to DSNALI.
> Below are the DB2 attach environments, their names, and my
notes on options
> how to make dynam work:
> IMS DFSLI000 DYNAM OK since DSNHLI alias resolves to
> in IMS RESLIB
> CICS DSNCLI Need a loadlib w/DSNHLI alias
> CAF DSNALI Needs a loadlib w/DSNHLI alias or PRECOMPILE W/
> RRS DSNRLI Needs a loadlib w/DSNHLI alias or PRECOMPILE W/
> TSO DSNELI DYNAM OK since DSNHLI alias resolves to DSNELI in
> I hope this helps.
> As alway, If there are any mistakes, I hope that someone will
> <[login to unmask email] To: [login to unmask email]
> LSTRA.COM> cc:
> Sent by: DB2 Subject: Re: Stored procedure calling
> Data Base sub-programs : Sqlcode -927
> <[login to unmask email]
> 09:25 PM
> Please respond
> to DB2 Data
> Thanx for ur replies. I did some more playing around before I
> replies, and got it working. But I am still trying to figure
out if I
> have fully understood all the possibilities. I am not too keen
> complex (eg. assembler stubs) solutions for my developers.
> Unfortunately, the manual mentions only abt the setting of
> PACKAGESETs and nothing abt the compile/link-edits for
> subprograms from SPs.
> (I guess I have just got used to IBM manuals describing
> little detail that when I don't find something, I get lots of
> My scenario is this : I have existing programs performing
> functions. Now these programs need to be called from the SP as
> These subprograms have originally been compiled with 'DYNAM'
> They may or may not call other programs. They do not have the
> module lined with them.
> From what I can see, the options for me r :
> (1) Call the subprograms in static mode (I suppose CALL
> the way to code), compile the SP with NODYNAM option, link the
> INCLUDEing the subprograms along with DSNALI. As Tim said, the
> then need relinking when the subprogram changes and the
> (2) Call them dynamically (CALL identifier), compile the SP
> option and link it with DSNALI. In this case, I wd need to
> subprograms with DSNALI and then store them in the SPAS
> dataset. I wd then be having two different copies of my
> Can somebody confirm if the above two options wd work ?
> Can I have a combination of both static and dynamic calls
> I am still playing around.......
> -----Original Message-----
> From: Nicholson, Martin [SMTP:[login to unmask email]
> Sent: Friday, December 21, 2001 2:24 AM
> To: [login to unmask email]
> Subject: Re: Stored procedure calling sub-programs : Sqlcode
> Assuming that your sub-program call is static and you include
> rather than object code:
> Could there be a problem in the way you are link editing the
> All the CLIs have the same entry point name. I believe the
> is the first one kept. Check the order of your includes.
> before you include your subprogram. If the DSNELI is found
> resolve the DSNHLI calls.
> > -----Original Message-----
> > From: teldb2kals [SMTP:[login to unmask email]
> > Sent: Wednesday, December 19, 2001 8:08 PM
> > To: [login to unmask email]
> > Subject: Stored procedure calling sub-programs : Sqlcode
> > Hi,
> > When a SProc calls other programs (with SQL in them), do
> > subprograms also need to be linked with DSNALI ? (we r
> > Procedure Addressspace).
> > We have a SP calling subprograms, but get an error -927
> > subprogram. Cd somebody lead us on the right way ?
> > Thanx.
> > Cheers,
> > Kals
> Powered by telstra.com
James A Campbell