DB2 for z/OS V9 - connect error via DSNREXX

Jim McAlpine

DB2 for z/OS V9 - connect error via DSNREXX
I'm getting the following -

13 *-*
/**********************************************************************/
14 *-* /* CHECK DSNREXX HOST COMMAND ENV
AVAILABLE */
15 *-*
/**********************************************************************/
16 *-* 'SUBCOM DSNREXX'
>L> "SUBCOM DSNREXX"
17 *-* IF RC
>V> "0"
19 *-*
/**********************************************************************/
20 *-* /* CONNECT TO
DB2Z */
21 *-*
/**********************************************************************/
22 *-* ADDRESS DSNREXX 'CONNECT' DB2Z
>L> "CONNECT"
>L> "DB2Z"
>O> "CONNECT DB2Z"
+++ RC(-1) +++
23 *-* IF SQLCODE ¬= 0
>V> "-922"
>L> "0"
>O> "1"
*-* THEN
*-* CALL SQLCA
23 +++ CALL SQLCA
IRX0043I Error running CLONELST, line 23: Routine not found

I have the DSNR class enabled for that DB2 subsystem with a UACC of READ
(it's just a test system). I can connect to other DB2 subsystems that are
set up in the same manner. Any ideas ?

Jim McAlpine

_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* Your only source for independent, unbiased, and trusted DB2 information. *
** The best DB2 technical sessions in the world
** Independent, not-for-profit, User Run - the IDUG difference!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv

Jim McAlpine

Re: DB2 for z/OS V9 - connect error via DSNREXX
(in response to Jim McAlpine)
On Tue, Nov 23, 2010 at 4:58 PM, Jim McAlpine <[login to unmask email]>wrote:

> I'm getting the following -
>
> 13 *-*
> /**********************************************************************/
> 14 *-* /* CHECK DSNREXX HOST COMMAND ENV
> AVAILABLE */
> 15 *-*
> /**********************************************************************/
> 16 *-* 'SUBCOM DSNREXX'
> >L> "SUBCOM DSNREXX"
> 17 *-* IF RC
> >V> "0"
> 19 *-*
> /**********************************************************************/
> 20 *-* /* CONNECT TO
> DB2Z */
> 21 *-*
> /**********************************************************************/
> 22 *-* ADDRESS DSNREXX 'CONNECT' DB2Z
> >L> "CONNECT"
> >L> "DB2Z"
> >O> "CONNECT DB2Z"
> +++ RC(-1) +++
> 23 *-* IF SQLCODE ¬= 0
> >V> "-922"
> >L> "0"
> >O> "1"
> *-* THEN
> *-* CALL SQLCA
> 23 +++ CALL SQLCA
> IRX0043I Error running CLONELST, line 23: Routine not found
>
> I have the DSNR class enabled for that DB2 subsystem with a UACC of READ
> (it's just a test system). I can connect to other DB2 subsystems that are
> set up in the same manner. Any ideas ?
>
> Jim McAlpine
>

Sorry, I should have said it's the -922 I'm interested in, please ignore the
routine not found error.

Jim McAlpine

_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* Your only source for independent, unbiased, and trusted DB2 information. *
** The best DB2 technical sessions in the world
** Independent, not-for-profit, User Run - the IDUG difference!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv

Todd Burch

Re: DB2 for z/OS V9 - connect error via DSNREXX
(in response to Jim McAlpine)
What's the REASON associated with the -922?

Todd


On Nov 23, 2010, at 11:05 AM, Jim McAlpine wrote:

On Tue, Nov 23, 2010 at 4:58 PM, Jim McAlpine <[login to unmask email]>
wrote:
I'm getting the following -

13 *-* /
**********************************************************************/
14 *-* /* CHECK DSNREXX HOST COMMAND ENV
AVAILABLE */
15 *-* /
**********************************************************************/
16 *-* 'SUBCOM DSNREXX'
>L> "SUBCOM DSNREXX"
17 *-* IF RC
>V> "0"
19 *-* /
**********************************************************************/
20 *-* /* CONNECT TO
DB2Z */
21 *-* /
**********************************************************************/
22 *-* ADDRESS DSNREXX 'CONNECT' DB2Z
>L> "CONNECT"
>L> "DB2Z"
>O> "CONNECT DB2Z"
+++ RC(-1) +++
23 *-* IF SQLCODE ¬= 0
>V> "-922"
>L> "0"
>O> "1"
*-* THEN
*-* CALL SQLCA
23 +++ CALL SQLCA
IRX0043I Error running CLONELST, line 23: Routine not found

I have the DSNR class enabled for that DB2 subsystem with a UACC of
READ (it's just a test system). I can connect to other DB2 subsystems
that are set up in the same manner. Any ideas ?

Jim McAlpine

Sorry, I should have said it's the -922 I'm interested in, please
ignore the routine not found error.

Jim McAlpine


_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* Your only source for independent, unbiased, and trusted DB2 information. *
** The best DB2 technical sessions in the world
** Independent, not-for-profit, User Run - the IDUG difference!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv

Jim McAlpine

Re: DB2 for z/OS V9 - connect error via DSNREXX
(in response to Todd Burch)
On Tue, Nov 23, 2010 at 5:51 PM, Todd Burch <[login to unmask email]> wrote:

> What's the REASON associated with the -922?
>
> Todd
>
>
Todd, what I posted is all I get. How can I determine the reason code.

Jim McAlpine

_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* If you are going to attend only one conference this year, this is it! *
** DB2 certification -> no additional charge
** Meet fellow DB2 users and leading DB2 consultants
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv

Martin Cox

Re: DB2 for z/OS V9 - connect error via DSNREXX
(in response to Jim McAlpine)
Hi,

The addition of the missing SQLCA routine should help:)

The reason code is probably in SQLERRMC.
/****************************************************************/
/* Routine to display the SQLCA */
/****************************************************************/
SQLCA:
SAY 'SQLCODE ='SQLCODE
SAY 'SQLERRMC ='SQLERRMC
SAY 'SQLERRP ='SQLERRP
SAY 'SQLERRD ='SQLERRD.1',',
|| SQLERRD.2',',
|| SQLERRD.3',',
|| SQLERRD.4',',
|| SQLERRD.5',',
|| SQLERRD.6
SAY 'SQLWARN ='SQLWARN.0',',
|| SQLWARN.1',',
|| SQLWARN.2',',
|| SQLWARN.3',',
|| SQLWARN.4',',
|| SQLWARN.5',',
|| SQLWARN.6',',
|| SQLWARN.7',',
|| SQLWARN.8',',
|| SQLWARN.9',',
|| SQLWARN.10
SAY 'SQLSTATE='SQLSTATE
SAY 'SQLCODE ='SQLCODE
EXIT

Cheers
Martin

From: IDUG DB2-L [mailto:[login to unmask email] On Behalf Of Jim McAlpine
Sent: 24 November 2010 08:55
To: [login to unmask email]
Subject: Re: [DB2-L] DB2 for z/OS V9 - connect error via DSNREXX

On Tue, Nov 23, 2010 at 5:51 PM, Todd Burch <[login to unmask email]<mailto:[login to unmask email]>> wrote:
What's the REASON associated with the -922?

Todd


Todd, what I posted is all I get. How can I determine the reason code.

Jim McAlpine

________________________________

[ http://www.idug.org/images/banners/idug_2011.gif ] < http://www.idug.org >

The IDUG DB2-L Listserv is only part of your membership in IDUG. If you are not already an IDUG member, please register here. < http://www.idug.org/register >

_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* If you are going to attend only one conference this year, this is it! *
** DB2 certification -> no additional charge
** Meet fellow DB2 users and leading DB2 consultants
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv

Jim McAlpine

Re: DB2 for z/OS V9 - connect error via DSNREXX
(in response to Martin Cox)
On Wed, Nov 24, 2010 at 9:06 AM, Martin Cox <[login to unmask email]> wrote:

> Hi,
>
>
>
> The addition of the missing SQLCA routine should helpJ
>
>
>
> The reason code is probably in SQLERRMC.
>
> /****************************************************************/
>
> /* Routine to display the SQLCA */
>
> /****************************************************************/
>
> SQLCA:
>
> SAY 'SQLCODE ='SQLCODE
>
> SAY 'SQLERRMC ='SQLERRMC
>
> SAY 'SQLERRP ='SQLERRP
>
> SAY 'SQLERRD ='SQLERRD.1',',
>
> || SQLERRD.2',',
>
> || SQLERRD.3',',
>
> || SQLERRD.4',',
>
> || SQLERRD.5',',
>
> || SQLERRD.6
>
> SAY 'SQLWARN ='SQLWARN.0',',
>
> || SQLWARN.1',',
>
> || SQLWARN.2',',
>
> || SQLWARN.3',',
>
> || SQLWARN.4',',
>
> || SQLWARN.5',',
>
> || SQLWARN.6',',
>
> || SQLWARN.7',',
>
> || SQLWARN.8',',
>
> || SQLWARN.9',',
>
> || SQLWARN.10
>
> SAY 'SQLSTATE='SQLSTATE
>
> SAY 'SQLCODE ='SQLCODE
>
> EXIT
>
>
>
> Cheers
>
> Martin
>
>
>

Thanks Martin, that got me past the initial auth problem. I'm now getting
an error when running the same REXX against DB2 V9 which runs successfully
against V8. The problem is with a fetch cursor which returns RC(1) as
follows. That statement executes in V8.

81 *-* ADDRESS DSNREXX EXECSQL "OPEN C1"
>L> "EXECSQL"
>L> "OPEN C1"
>O> "EXECSQL OPEN C1"
82 *-* IF SQLCODE /= 0
>V> "0"
>L> "0"
>O> "0"
97 *-* /* FETCH DATA */
98 *-* ADDRESS DSNREXX EXECSQL "FETCH C1 USING DESCRIPTOR :OUTSQLDA"
>L> "EXECSQL"
>L> "FETCH C1 USING DESCRIPTOR :OUTSQLDA"
>O> "EXECSQL FETCH C1 USING DESCRIPTOR :OUTSQLDA"
+++ RC(1) +++
99 *-* DO UNTIL SQLCODE /= 0

Jim McAlpine

_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* If you are going to attend only one conference this year, this is it! *
** DB2 certification -> no additional charge
** Meet fellow DB2 users and leading DB2 consultants
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv

Todd Burch

Re: DB2 for z/OS V9 - connect error via DSNREXX
(in response to Jim McAlpine)
An SQL warning occurred.

http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/topic/com.ibm.db29.doc.apsg/db2z_sqlstatementsrexx.htm

Todd




Thanks Martin, that got me past the initial auth problem. I'm now
getting an error when running the same REXX against DB2 V9 which runs
successfully against V8. The problem is with a fetch cursor which
returns RC(1) as follows. That statement executes in V8.

81 *-* ADDRESS DSNREXX EXECSQL "OPEN C1"
>L> "EXECSQL"
>L> "OPEN C1"
>O> "EXECSQL OPEN C1"
82 *-* IF SQLCODE /= 0
>V> "0"
>L> "0"
>O> "0"
97 *-* /* FETCH DATA */
98 *-* ADDRESS DSNREXX EXECSQL "FETCH C1 USING DESCRIPTOR :OUTSQLDA"
>L> "EXECSQL"
>L> "FETCH C1 USING DESCRIPTOR :OUTSQLDA"
>O> "EXECSQL FETCH C1 USING DESCRIPTOR :OUTSQLDA"
+++ RC(1) +++
99 *-* DO UNTIL SQLCODE /= 0

Jim McAlpine


_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* If you are going to attend only one conference this year, this is it! *
** DB2 certification -> no additional charge
** Meet fellow DB2 users and leading DB2 consultants
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv

Phil Grainger

Re: DB2 for z/OS V9 - connect error via DSNREXX
(in response to Todd Burch)
And it'll be in the SQLCA (again)
Phil Grainger
Cogito Ltd.
[login to unmask email]
+44 (0) 1298 872 148
+44 (0) 7505 266 768
www.cogito.co.uk <blocked:: http://www.cogito.co.uk >

Attend IDUG 2011 - the premiere events for DB2 professionals.
IDUG North America < http://www.idug.org/na > , 2-6 May, Anaheim California
IDUG EMEA < http://www.idug.org/emea > , 14-18 November, Prague Czech Republic


From: IDUG DB2-L [mailto:[login to unmask email] On Behalf Of Todd Burch
Sent: 24 November 2010 17:31
To: [login to unmask email]
Subject: Re: [DB2-L] DB2 for z/OS V9 - connect error via DSNREXX

An SQL warning occurred.

http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/topic/com.ibm.db29.doc.apsg/db2z_sqlstatementsrexx.htm

Todd




Thanks Martin, that got me past the initial auth problem. I'm now getting an error when running the same REXX against DB2 V9 which runs successfully against V8. The problem is with a fetch cursor which returns RC(1) as follows. That statement executes in V8.

81 *-* ADDRESS DSNREXX EXECSQL "OPEN C1"
>L> "EXECSQL"
>L> "OPEN C1"
>O> "EXECSQL OPEN C1"
82 *-* IF SQLCODE /= 0
>V> "0"
>L> "0"
>O> "0"
97 *-* /* FETCH DATA */
98 *-* ADDRESS DSNREXX EXECSQL "FETCH C1 USING DESCRIPTOR :OUTSQLDA"
>L> "EXECSQL"
>L> "FETCH C1 USING DESCRIPTOR :OUTSQLDA"
>O> "EXECSQL FETCH C1 USING DESCRIPTOR :OUTSQLDA"
+++ RC(1) +++
99 *-* DO UNTIL SQLCODE /= 0

Jim McAlpine


________________________________

[ http://www.idug.org/images/banners/idug_2011.gif ] < http://www.idug.org >

The IDUG DB2-L Listserv is only part of your membership in IDUG. If you are not already an IDUG member, please register here. < http://www.idug.org/register >

_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* Your only source for independent, unbiased, and trusted DB2 information. *
_____________________________________________________________________
http://www.IDUG.org/mentor
How can you expand your staff or do succession planning in this economy?
Mentoring is a proven, economical, way to train the next generation of DB2 Users!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv

Jim McAlpine

Re: DB2 for z/OS V9 - connect error via DSNREXX
(in response to Phil Grainger)
On Thu, Nov 25, 2010 at 1:13 PM, Phil Grainger
<[login to unmask email]>wrote:

> And it’ll be in the SQLCA (again)
>
> *Phil Grainger*
> Cogito Ltd.
>
> [login to unmask email]
> +44 (0) 1298 872 148
> +44 (0) 7505 266 768
>
> www.cogito.co.uk
>
>
>

Thanks for all the pointers, problem solved.

Jim McAlpine

_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* Your only source for independent, unbiased, and trusted DB2 information. *
_____________________________________________________________________
http://www.IDUG.org/mentor
How can you expand your staff or do succession planning in this economy?
Mentoring is a proven, economical, way to train the next generation of DB2 Users!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv

David Simpson

Re: DB2 for z/OS V9 - connect error via DSNREXX
(in response to Jim McAlpine)
A few years back Rich Fazio figured out how to call DSNTIAR from REXX to
get a coherent display of the SQLCA. It is below:



SQLERR_RTN_DISPLAY:

Say "SQL STATEMENT RECEIVEING ERROR FOLLOWS"

Say "--------------------------------------------------"

Do X = 1 TO SQLSTMT.0;Say SQLSTMT.X;End

Say "--------------------------------------------------"

Say "APPLICATION DIAGNOSTICS"

Say ERROR_NOTE

Say ERROR_AID

Say "DB2 DIAGNOSTICS FOLLOW:"

Say "--------------------------------------------------"

/* Package SQLCA for DSNTIAR usage */

NUMERIC DIGITS 10 /* Allow for big numbers in SQLCA */

SQL_ERRD = "";Do I = 1 To 6;SQL_ERRD = SQL_ERRD||D2C(SQLERRD.I,4);End

SQL_WARN = "";Do I = 0 To 10;SQL_WARN = SQL_WARN||LEFT(SQLWARN.I,1);End

SQLCA = 'SQLCA '||D2C(136,4)||D2C(SQLCODE,4)||D2C(70,2),

||LEFT(SQLERRMC,70)||'DSN '||SQL_ERRD||SQL_WARN||LEFT(SQLSTATE,5)

/* If the length is beyond DSNTIAR possible values (72-240), reset */

If MSG_LEN < 72 | MSG_LEN > 240 Then MSG_LEN = 120 /* Outside scope */

If MSG_LEN = "MSG_LEN" Then MSG_LEN = 120 /* Default msg length 120 */

DB2_ERR_MSG = D2C(MSG_LEN * 12,2) || COPIES(' ',MSG_LEN * 12)

DB2_ERR_LEN = D2C(MSG_LEN,4)

Address /* Execute DSNTIAR program with SQLCA/Parm data */

Address LINKPGM "DSNTIAR SQLCA DB2_ERR_MSG DB2_ERR_LEN"

If RC < 5 Then,

Do

If RC = 4 Then Say "DSNTIAR RC=4 Message Area Truncated"

S_POS = 3 /* Bypass the length bytes in Message Area */

Do I = 1 to 12 /* Loop through all lines of message */

MSG_TEXT = Substr(DB2_ERR_MSG,S_POS,MSG_LEN) /* Pick out text */

MSG_TEXT = Strip(MSG_TEXT,T," ") /* Remove trailing blanks */

If MSG_TEXT > " " Then Say MSG_TEXT /* Echo msg to terminal */

Else Iterate /* Some msg lines are blank, skip */

S_POS = S_POS + MSG_LEN /* Skip to next "line" of MSG data */

End I

End

Else,

Do /* If DSNTIAR fails for any reason, print SQLCA info anyway */

Say "Call to DSNTIAR - Failed. RC=" RC

Say 'SQLCODE ='SQLCODE; Say 'SQLERRM ='SQLERRMC

Say 'SQLERRP ='SQLERRP; Say 'SQLSTATE='SQLSTATE

XX = "SQLERRD =";Do I = 1 to 6 ; XX = XX||SQLERRD.I||',';End;Say XX

XX = "SQLWARN =";Do I = 0 to 10; XX = XX||SQLWARN.I||',';End;Say XX

End

Address

Return;







________________________________________________________________________
______
David Simpson | Senior Technical Advisor | Themis Education
123 South Avenue E, Westfield NJ, 07090 | phone 908-233-8900 |
[login to unmask email] <mailto:[login to unmask email]>

For more information about Themis, visit www.themisinc.com
< http://www.themisinc.com/ >





From: IDUG DB2-L [mailto:[login to unmask email] On Behalf Of Jim McAlpine
Sent: Thursday, November 25, 2010 9:41 AM
To: [login to unmask email]
Subject: Re: [DB2-L] DB2 for z/OS V9 - connect error via DSNREXX



On Thu, Nov 25, 2010 at 1:13 PM, Phil Grainger
<[login to unmask email]> wrote:

And it'll be in the SQLCA (again)

Phil Grainger
Cogito Ltd.

[login to unmask email]
+44 (0) 1298 872 148
+44 (0) 7505 266 768

www.cogito.co.uk





Thanks for all the pointers, problem solved.



Jim McAlpine



________________________________

Independent, not-for-profit, User Run - the IDUG difference!
< http://www.idug.org >

The IDUG DB2-L Listserv is only part of your membership in IDUG. If you
are not already an IDUG member, please register here.
< http://www.idug.org/register >


_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* Your only source for independent, unbiased, and trusted DB2 information. *
_____________________________________________________________________
http://www.IDUG.org/mentor
How can you expand your staff or do succession planning in this economy?
Mentoring is a proven, economical, way to train the next generation of DB2 Users!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv

Martin Cox

Re: DB2 for z/OS V9 - connect error via DSNREXX
(in response to David Simpson)
Thanks.

I've had a quick look at the code and suspect that the "else iterate" is surplus to requirements and if the MSG_TEXT is ever greater than blank the code will loop.

If MSG_TEXT > " " Then Say MSG_TEXT /* Echo msg to terminal */
Else Iterate /* Some msg lines are blank, skip */
S_POS = S_POS + MSG_LEN /* Skip to next "line" of MSG data */


Cheers
Martin

From: IDUG DB2-L [mailto:[login to unmask email] On Behalf Of David Simpson
Sent: 26 November 2010 00:46
To: [login to unmask email]
Subject: Re: [DB2-L] DB2 for z/OS V9 - connect error via DSNREXX

A few years back Rich Fazio figured out how to call DSNTIAR from REXX to get a coherent display of the SQLCA. It is below:

SQLERR_RTN_DISPLAY:
Say "SQL STATEMENT RECEIVEING ERROR FOLLOWS"
Say "--------------------------------------------------"
Do X = 1 TO SQLSTMT.0;Say SQLSTMT.X;End
Say "--------------------------------------------------"
Say "APPLICATION DIAGNOSTICS"
Say ERROR_NOTE
Say ERROR_AID
Say "DB2 DIAGNOSTICS FOLLOW:"
Say "--------------------------------------------------"
/* Package SQLCA for DSNTIAR usage */
NUMERIC DIGITS 10 /* Allow for big numbers in SQLCA */
SQL_ERRD = "";Do I = 1 To 6;SQL_ERRD = SQL_ERRD||D2C(SQLERRD.I,4);End
SQL_WARN = "";Do I = 0 To 10;SQL_WARN = SQL_WARN||LEFT(SQLWARN.I,1);End
SQLCA = 'SQLCA '||D2C(136,4)||D2C(SQLCODE,4)||D2C(70,2),
||LEFT(SQLERRMC,70)||'DSN '||SQL_ERRD||SQL_WARN||LEFT(SQLSTATE,5)
/* If the length is beyond DSNTIAR possible values (72-240), reset */
If MSG_LEN < 72 | MSG_LEN > 240 Then MSG_LEN = 120 /* Outside scope */
If MSG_LEN = "MSG_LEN" Then MSG_LEN = 120 /* Default msg length 120 */
DB2_ERR_MSG = D2C(MSG_LEN * 12,2) || COPIES(' ',MSG_LEN * 12)
DB2_ERR_LEN = D2C(MSG_LEN,4)
Address /* Execute DSNTIAR program with SQLCA/Parm data */
Address LINKPGM "DSNTIAR SQLCA DB2_ERR_MSG DB2_ERR_LEN"
If RC < 5 Then,
Do
If RC = 4 Then Say "DSNTIAR RC=4 Message Area Truncated"
S_POS = 3 /* Bypass the length bytes in Message Area */
Do I = 1 to 12 /* Loop through all lines of message */
MSG_TEXT = Substr(DB2_ERR_MSG,S_POS,MSG_LEN) /* Pick out text */
MSG_TEXT = Strip(MSG_TEXT,T," ") /* Remove trailing blanks */
If MSG_TEXT > " " Then Say MSG_TEXT /* Echo msg to terminal */
Else Iterate /* Some msg lines are blank, skip */
S_POS = S_POS + MSG_LEN /* Skip to next "line" of MSG data */
End I
End
Else,
Do /* If DSNTIAR fails for any reason, print SQLCA info anyway */
Say "Call to DSNTIAR - Failed. RC=" RC
Say 'SQLCODE ='SQLCODE; Say 'SQLERRM ='SQLERRMC
Say 'SQLERRP ='SQLERRP; Say 'SQLSTATE='SQLSTATE
XX = "SQLERRD =";Do I = 1 to 6 ; XX = XX||SQLERRD.I||',';End;Say XX
XX = "SQLWARN =";Do I = 0 to 10; XX = XX||SQLWARN.I||',';End;Say XX
End
Address
Return;



______________________________________________________________________________
David Simpson | Senior Technical Advisor | Themis Education
123 South Avenue E, Westfield NJ, 07090 | phone 908-233-8900 | [login to unmask email]<mailto:[login to unmask email]>
For more information about Themis, visit www.themisinc.com < http://www.themisinc.com/ >


From: IDUG DB2-L [mailto:[login to unmask email] On Behalf Of Jim McAlpine
Sent: Thursday, November 25, 2010 9:41 AM
To: [login to unmask email]
Subject: Re: [DB2-L] DB2 for z/OS V9 - connect error via DSNREXX

On Thu, Nov 25, 2010 at 1:13 PM, Phil Grainger <[login to unmask email]<mailto:[login to unmask email]>> wrote:
And it'll be in the SQLCA (again)
Phil Grainger
Cogito Ltd.
[login to unmask email]<mailto:[login to unmask email]>
+44 (0) 1298 872 148
+44 (0) 7505 266 768
www.cogito.co.uk


Thanks for all the pointers, problem solved.

Jim McAlpine

________________________________

[ http://www.idug.org/images/banners/idug_2011.gif ] < http://www.idug.org >

The IDUG DB2-L Listserv is only part of your membership in IDUG. If you are not already an IDUG member, please register here. < http://www.idug.org/register >

________________________________

[ http://www.idug.org/images/banners/idug_2011.gif ] < http://www.idug.org >

The IDUG DB2-L Listserv is only part of your membership in IDUG. If you are not already an IDUG member, please register here. < http://www.idug.org/register >

_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* If you are going to attend only one conference this year, this is it! *
_____________________________________________________________________
http://www.IDUG.org/mentor
Mentoring should be a rewarding experience for everyone...
IDUG is offering up to 80% off when you both come to the conference!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv