DSNTEP4 uses multi row fetch. This is not supported by Db2 (LUW). (Might be now -
wasn't when I tried)
OP will need to bind DSNTEP2 (well, the DSN@EP2L (?) DBRM) into the Db2 (LUW) and
use that.
James Campbell
On 26 May 2023 at 18:53, Jaime Fernandez via International DB2 Use wrote:
> Hi Steve,
>
> There is something else you need in order to run SQL from Db2 zOS into a LUW instance.
>
> On the mainframe side, your SQL will be proccessed through a certain package. Depending on the interface you try to use, that could be DSNESM68 (Spufi), DSNTEP2 or TEP4 (batch), ADBMAIN - if I remember correctly (Db2 Administration Tool), and so on.
>
> Once the connection to the LUW database is established, the problem is that any SQL instruction sent by a certain zOS package expects a version of that very same package to exist on the LUW database. That is, you need that package on both sides in order to the federated SQL sentence to work.
>
> Since all those packages are specifically mainframe ones, I don't think there is much you can do on the LUW side. What I would do, is to BIND COPY those packages, from zOS to LUW (using the remote location).
>
> Most likely you will need to use the ON ERROR (CONTINUE) bind option, just in case some of the instructions on those zOS packages are not supported by LUW. But that's ok, as long as the package exists on the LUW side everything should work just fine.
>
> Also, the user id you use to run those BIND COPYs will need to have bind authority granted on the LUW database.
>
> HTH
>
>
> ------------------------------
> Jaime Fernandez
> ------------------------------
> -------------------------------------------
> Original Message:
> Sent: May 26, 2023 11:16 AM
> From: Steve Bourgeois
> Subject: z/OS to LUW query -805 INVALID APPLICATION STATE
>
>
> I get this message when running in batch.
> DSNT408I SQLCODE = -805, SQLSTATE = 51002, INVALID APPLICATION STATE FROM DB2 UDB FOR AIX,LINUX,HP-UX,SUN OR WINDOWS
> TOKENS DSNTEP4.DSN@EP4L 0X1B3BA8330354D7D6
>
> I know I am missing one little piece. Now just hunting for what the piece is.
>
>
> ------------------------------
> SteveBourgeoisTexas Farm Bureau
> ------------------------------
>
> Original Message:
> Sent: May 26, 2023 10:57 AM
> From: Steve Bourgeois
> Subject: z/OS to LUW query -805 INVALID APPLICATION STATE
>
>
> I have finally been able to get all the necessary pieces and parts in place to reach out to a LUW Db2 instance running on windows.
> Now I am receiving the following error.
>
> DSNT408I SQLCODE = -805, SQLSTATE = 51002, INVALID APPLICATION STATE FROM
> DB2 UDB FOR AIX,LINUX,HP-UX,SUN AND WINDOWS TOKENS DSNESPCS.DSNESM68
> 0X1A0D8BD811DAADD8
>
> Searching the net seems futile.
> The System DBA has really helped, but is stumped on this.
>
> How do I get this bound up on the LUW side?
>
> Thank you,
>
>
> ------------------------------
> SteveBourgeoisTexas Farm Bureau
> ------------------------------
>
Original Message:
Sent: 5/26/2023 2:54:00 PM
From: Jaime Fernandez
Subject: RE: z/OS to LUW query -805 INVALID APPLICATION STATE
Hi Steve,
There is something else you need in order to run SQL from Db2 zOS into a LUW instance.
On the mainframe side, your SQL will be proccessed through a certain package. Depending on the interface you try to use, that could be DSNESM68 (Spufi), DSNTEP2 or TEP4 (batch), ADBMAIN - if I remember correctly (Db2 Administration Tool), and so on.
Once the connection to the LUW database is established, the problem is that any SQL instruction sent by a certain zOS package expects a version of that very same package to exist on the LUW database. That is, you need that package on both sides in order to the federated SQL sentence to work.
Since all those packages are specifically mainframe ones, I don't think there is much you can do on the LUW side. What I would do, is to BIND COPY those packages, from zOS to LUW (using the remote location).
Most likely you will need to use the ON ERROR (CONTINUE) bind option, just in case some of the instructions on those zOS packages are not supported by LUW. But that's ok, as long as the package exists on the LUW side everything should work just fine.
Also, the user id you use to run those BIND COPYs will need to have bind authority granted on the LUW database.
HTH
------------------------------
Jaime Fernandez
------------------------------
Original Message:
Sent: May 26, 2023 11:16 AM
From: Steve Bourgeois
Subject: z/OS to LUW query -805 INVALID APPLICATION STATE
I get this message when running in batch.
DSNT408I SQLCODE = -805, SQLSTATE = 51002, INVALID APPLICATION STATE FROM DB2 UDB FOR AIX,LINUX,HP-UX,SUN OR WINDOWS
TOKENS DSNTEP4.DSN@EP4L 0X1B3BA8330354D7D6
I know I am missing one little piece. Now just hunting for what the piece is.
------------------------------
SteveBourgeoisTexas Farm Bureau
Original Message:
Sent: May 26, 2023 10:57 AM
From: Steve Bourgeois
Subject: z/OS to LUW query -805 INVALID APPLICATION STATE
I have finally been able to get all the necessary pieces and parts in place to reach out to a LUW Db2 instance running on windows.
Now I am receiving the following error.
DSNT408I SQLCODE = -805, SQLSTATE = 51002, INVALID APPLICATION STATE FROM
DB2 UDB FOR AIX,LINUX,HP-UX,SUN AND WINDOWS TOKENS DSNESPCS.DSNESM68
0X1A0D8BD811DAADD8
Searching the net seems futile.
The System DBA has really helped, but is stumped on this.
How do I get this bound up on the LUW side?
Thank you,
------------------------------
SteveBourgeoisTexas Farm Bureau
------------------------------