How do I control the type of connection DSNREXX EXECSQL is used?
One of my programmer have the following senarios that make me confuse:
A main rexx is calling a rexx routines via ispf dialog commandS. One routine is executing the DSNREXX CONNECT command succsefully and another routine executing the DSNREXX EXECSQL command recieve SQLCODE -981 with reason code 00C12219.
When looking on the thread in TMON, after the CONNECT I can see the thread with conn-id DB2CALL, and then the EXECSQL failed with the -981.
When adding DSNREXX CONNECT in the same routine executing the EXECSQL - it's work using DB2CALL conn-id.
When the DSNREXX CONNECT conmand is totaly removed and the rexx execute only the DSNREXX EXECSQL the command is executed succefuly, but this time the conn-id of the thread is RRSAF!
in another environmet that use the same software version all over, the original main rexx is working, but when I look for the connection in TMON - no thread is open after the DSNREXX CONNECT (ending with RC=0), and after the DSNREXX EXECSQL a thread conn-id rrsaf is open.
The DSNREXX load module exists only in the DB2 SDSNLOAD library which is define in the linklist.
DSNHLI alias exists only in this library as well and is an alias on the DSNELI, & DSNRLI & DSNCLI exist as well only in the DB2 SDSNLOAD with their aliases.
Can some one can explain me this?
What should I look for?
How come DSNREXX EXECSQL is working without a CONNECT?
What cuase the connection to be open via RRSAF?
This topic has been locked.
3 replies Latest Post - 2013-03-09T22:39:54Z by SystemAdmin
Pinned topic dsnrexx exec SQL sqlcode -981 reason code 00c12219
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2013-03-09T22:39:54Z at 2013-03-09T22:39:54Z by SystemAdmin
Re: dsnrexx exec SQL sqlcode -981 reason code 00c122192013-02-26T15:49:59Z in response to SystemAdminthis
clearly specifies that you must issue a dsnrexx connect in order to be able to issue SQL statements from your REXX script, which leads to the question -
is it possible that you have a connect statement somewhere that you are not aware of? so, the connect statement you do see is the second one and it causes some corruption to the actual connection?
as for using rrsaf, how are your rexx packages bound?
Re: dsnrexx exec SQL sqlcode -981 reason code 00c122192013-03-03T07:34:30Z in response to SystemAdminHi,
I know that the IBM docs clearly explain that you must have a DSNREXX connect that is why I was surprise.
I must admit that the REXX application is not really mine. I asked the programmer who wrote it, to add TRACE and I've executed it in purpose to find his problem, and there was no connect command. It might be that he put trace off some were but I do not believe it. Any way even if there was one, than the question is why the connection used was RRSAF, and how come that the DSNREXX SQLEXEC command runs successfully? And why when the DSNREXX CONNECT was executed the DSNREXX SQLEXEC failed on -981 with 00C12219?
Our REXX Packages are bounded as in the IBM installation sample job with enable (*), and they use the DBRM from our DB2 installation library. How the BIND can influence the connection type used?
Re: dsnrexx exec SQL sqlcode -981 reason code 00c122192013-03-09T22:39:54Z in response to SystemAdminThe bind package has a parameter called enable which dictates which attachement facitilities can be used with this package
you can disable RRSAF (or only enable TSO and BATCH for example)