Get current DB2 release form REXX

Robin Willoughby

Get current DB2 release form REXX
Can somebody suggest a straight forward way to identify which release level
a DB2 subsystem is at when connected via DSNREXX from a REXX program ?

cheers,

Robin

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Hans Schuermann

Re: Get current DB2 release form REXX
(in response to Robin Willoughby)
Hello Robin,

You could invoke DSN command processor, issue a -DIS GROUP and analyze
the result. As far as I know -DIS GROUP works in a non-datasharing DB2.

Hans Schuermann
dbpro GmbH

Robin WIlloughby wrote:
> Can somebody suggest a straight forward way to identify which release level
> a DB2 subsystem is at when connected via DSNREXX from a REXX program ?
>
> cheers,
>
> Robin
>
> ---------------------------------------------------------------------------------
> Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm
>
>

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Markus Liebenberg

Re: Get current DB2 release form REXX
(in response to Hans Schuermann)
Sample output from -DIS GROUP in a non-DS environment

DSN7100I -DSN7 DSN7GCMD
*** BEGIN DISPLAY OF GROUP(........) GROUP LEVEL(...)
GROUP ATTACH NAME(....)
--------------------------------------------------------------------
DB2 DB2 SYSTEM IRLM
MEMBER ID SUBSYS CMDPREF STATUS LVL NAME SUBSYS IRLMPROC
-------- --- ---- -------- -------- --- -------- ---- --------
........ 0 DSN7 -DSN7 ACTIVE 710 XXXX IRL7 DSN7IRLM
--------------------------------------------------------------------
*** END DISPLAY OF GROUP(........)
DSN9022I -DSN7 DSN7GCMD 'DISPLAY GROUP ' NORMAL COMPLETION
***


-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email]On
Behalf Of Hans Schuermann
Sent: 06 December 2004 17:03
To: [login to unmask email]
Subject: Re: Get current DB2 release form REXX


Hello Robin,

You could invoke DSN command processor, issue a -DIS GROUP and analyze
the result. As far as I know -DIS GROUP works in a non-datasharing DB2.

Hans Schuermann
dbpro GmbH

Robin WIlloughby wrote:
> Can somebody suggest a straight forward way to identify which release level
> a DB2 subsystem is at when connected via DSNREXX from a REXX program ?
>
> cheers,
>
> Robin
>
> ---------------------------------------------------------------------------------
> Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm
>
>

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm
------------------------------------------------------------------------
Confidentiality Note: The information contained in this email and
document(s) attached are for the exclusive use of the addressee and may
contain confidential, privileged and non-disclosable information. If the
recipient of this email is not the addressee, such recipient is strictly
prohibited from reading, photocopying, distribution or otherwise using this
email or its contents in any way. Please notify the Sapiens (UK) Ltd.
Systems Administrator via e-mail immediately at
[login to unmask email], if you have received this email in error.

Disclaimer: The views, opinions and guidelines contained in this
confidential e-mail are those of the originating author and may not be
representative of Sapiens (UK) Ltd.
------------------------------------------------------------------------

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

James Campbell

Re: Get current DB2 release form REXX
(in response to Markus Liebenberg)
/* untested */
address dsnrexx "execsql connect"
say "DB2 product code = " substr(sqlerrp,1,3)", V.R.M = "substr
(sqlerrp,3,2)'.',
substr(sqlerrp,5,2)'.'substr(sqlerrp,7,2)

James Campbell


On Mon, 6 Dec 2004 09:44:33 -0600, Robin WIlloughby
<[login to unmask email]> wrote:

>Can somebody suggest a straight forward way to identify which release level
>a DB2 subsystem is at when connected via DSNREXX from a REXX program ?
>
>cheers,
>
>Robin
>

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Lucious Walls

Re: Get current DB2 release form REXX
(in response to James Campbell)
James,

I took the liberty and tested the code you submitted to get the current DB2 release from REXX. What returned from running wasn't exactly what I expected. I received the following result: "DB2 product code = SQL, V.R.M = LE.RR.P". I thought I would get a result like 7.1. which is the current DB2 release at our shop.

Regards,

Lucious Walls
SPAWAR ITC (Washington)
[login to unmask email]
703-693-0940 DSN 223-0940

-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email]On
Behalf Of James Campbell
Sent: Monday, December 06, 2004 11:18 PM
To: [login to unmask email]
Subject: Re: Get current DB2 release form REXX


/* untested */
address dsnrexx "execsql connect"
say "DB2 product code = " substr(sqlerrp,1,3)", V.R.M = "substr
(sqlerrp,3,2)'.',
substr(sqlerrp,5,2)'.'substr(sqlerrp,7,2)

James Campbell


On Mon, 6 Dec 2004 09:44:33 -0600, Robin WIlloughby
<[login to unmask email]> wrote:

>Can somebody suggest a straight forward way to identify which release level
>a DB2 subsystem is at when connected via DSNREXX from a REXX program ?
>
>cheers,
>
>Robin
>

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

James Campbell

Re: Get current DB2 release form REXX
(in response to Lucious Walls)
One problem is that my starting positions were out. Should be
", V.R.M = "substr(sqlerrp,4,2)'.',
substr(sqlerrp,6,2)'.'substr(sqlerrp,8,1)

The other is that it appears that SQLERRP has not been assigned a value -
which will happen each time execsql is invoked.

You have done the
"SUBCOM DSNREXX"
IF RC THEN S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
ADDRESS DSNREXX "CONNECT" SSID
IF SQLCODE ¬= 0 THEN /* handle error */
first, and tested SQLCODE after the "EXECSQL CONNECT" haven't you?

Currently I am not in a position to debug the code myself.

James Campbell

On Tue, 7 Dec 2004 11:26:39 -0500, Walls, Lucious G CONT (SITC)
<[login to unmask email]> wrote:

>James,
>
>I took the liberty and tested the code you submitted to get the current
DB2 release from REXX. What returned from running wasn't exactly what I
expected. I received the following result: "DB2 product code = SQL, V.R.M
= LE.RR.P". I thought I would get a result like 7.1. which is the current
DB2 release at our shop.
>
>Regards,
>
>Lucious Walls
>SPAWAR ITC (Washington)
>[login to unmask email]
>703-693-0940 DSN 223-0940
>
>-----Original Message-----
>From: DB2 Data Base Discussion List [mailto:[login to unmask email]On
>Behalf Of James Campbell
>Sent: Monday, December 06, 2004 11:18 PM
>To: [login to unmask email]
>Subject: Re: Get current DB2 release form REXX
>
>
>/* untested */
>address dsnrexx "execsql connect"
>say "DB2 product code = " substr(sqlerrp,1,3)", V.R.M = "substr
>(sqlerrp,3,2)'.',
> substr(sqlerrp,5,2)'.'substr(sqlerrp,7,2)
>
>James Campbell
>
>
>On Mon, 6 Dec 2004 09:44:33 -0600, Robin WIlloughby
><[login to unmask email]> wrote:
>
>>Can somebody suggest a straight forward way to identify which release
level
>>a DB2 subsystem is at when connected via DSNREXX from a REXX program ?
>>
>>cheers,
>>
>>Robin
>>

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Roland Schiradin

Re: Get current DB2 release form REXX
(in response to James Campbell)
James,

hmmhhh well I using the "old" offsets.

7 *-* ssid = "DB2S"
>>> "DB2S"
IRX0100I +++ Interactive trace. TRACE OFF to end debug, ENTER to contin


8 *-* Address DSNREXX "CONNECT" SSID
>>> "CONNECT DB2S"

9 *-* If SQLCODE ^= 0
>>> "0"

10 *-* say "DB2 product code = " substr(sqlerrp,1,3)", V.R.M = ",
substr(sqlerrp,3,2)'.',
substr(sqlerrp,5,2)'.'substr(sqlerrp,7,2)
>>> "DB2 product code = DSN, V.R.M = NT. ZA.LI"
DB2 product code = DSN, V.R.M = NT. ZA.LI
say sqlerrp
DSNTZALI

13 *-* SQLSTMT = ,
"SELECT PHONENO FROM DSN8610.EMP WHERE LASTNAME = 'HAAS' "
>>> "SELECT PHONENO FROM DSN8610.EMP WHERE LASTNAME = 'HAAS' "

15 *-* /* dsn_sql = "DECLARE C1 CURSOR FOR S1"
Address DSNREXX "EXECSQL" DSN_SQL
If SQLCODE ^= 0 Then Call SQLCA
Say "SQLCODE from Declare is "SQLCODE
*/
20 *-* dsn_sql = "PREPARE S1 FROM :SQLSTMT"
>>> "PREPARE S1 FROM :SQLSTMT"

21 *-* Address DSNREXX "EXECSQL" DSN_SQL
>>> "EXECSQL PREPARE S1 FROM :SQLSTMT"

22 *-* say "DB2 product code = " substr(sqlerrp,1,3)", V.R.M = ",
substr(sqlerrp,3,2)'.',
substr(sqlerrp,5,2)'.'substr(sqlerrp,7,2)
>>> "DB2 product code = DSN, V.R.M = N . . "
DB2 product code = DSN, V.R.M = N . .
say sqlerrp
DSN


Roland


-----Ursprüngliche Nachricht-----
Von: DB2 Data Base Discussion List [mailto:[login to unmask email] Im Auftrag von James Campbell
Gesendet: Dienstag, 7. Dezember 2004 23:23
An: [login to unmask email]
Betreff: Re: Get current DB2 release form REXX


One problem is that my starting positions were out. Should be ", V.R.M = "substr(sqlerrp,4,2)'.',
substr(sqlerrp,6,2)'.'substr(sqlerrp,8,1)

The other is that it appears that SQLERRP has not been assigned a value - which will happen each time execsql is invoked.

You have done the
"SUBCOM DSNREXX"
IF RC THEN S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
ADDRESS DSNREXX "CONNECT" SSID
IF SQLCODE ¬= 0 THEN /* handle error */
first, and tested SQLCODE after the "EXECSQL CONNECT" haven't you?

Currently I am not in a position to debug the code myself.

James Campbell

On Tue, 7 Dec 2004 11:26:39 -0500, Walls, Lucious G CONT (SITC) <[login to unmask email]> wrote:

>James,
>
>I took the liberty and tested the code you submitted to get the current
DB2 release from REXX. What returned from running wasn't exactly what I expected. I received the following result: "DB2 product code = SQL, V.R.M = LE.RR.P". I thought I would get a result like 7.1. which is the current DB2 release at our shop.
>
>Regards,
>
>Lucious Walls
>SPAWAR ITC (Washington)
>[login to unmask email]
>703-693-0940 DSN 223-0940
>
>-----Original Message-----
>From: DB2 Data Base Discussion List [mailto:[login to unmask email]On
>Behalf Of James Campbell
>Sent: Monday, December 06, 2004 11:18 PM
>To: [login to unmask email]
>Subject: Re: Get current DB2 release form REXX
>
>
>/* untested */
>address dsnrexx "execsql connect"
>say "DB2 product code = " substr(sqlerrp,1,3)", V.R.M = "substr
>(sqlerrp,3,2)'.',
> substr(sqlerrp,5,2)'.'substr(sqlerrp,7,2)
>
>James Campbell
>
>
>On Mon, 6 Dec 2004 09:44:33 -0600, Robin WIlloughby
><[login to unmask email]> wrote:
>
>>Can somebody suggest a straight forward way to identify which release
level
>>a DB2 subsystem is at when connected via DSNREXX from a REXX program ?
>>
>>cheers,
>>
>>Robin
>>

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Charlie Kondo

Re: Get current DB2 release form REXX
(in response to Roland Schiradin)
Try this
/* REXX
RETRIEVE SQLERRP TO FORMAT DB2 VER.REL
*/
ARG SSN
ADDRESS DSNREXX
"CONNECT "SSN
IF SQLCODE ¬= 0 THEN SAY 'ADDRESS FAILED'

ADDRESS DSNREXX "EXECSQL CONNECT"
SAY "DB2 SQLERRP:" SQLERRP /* DISPLAYS DSN07010 */
DB2V = SUBSTR(SQLERRP,4,2)
DB2R = SUBSTR(SQLERRP,6,2)
SAY 'DB2 VER:' DB2V'.'DB2R
RETURN

Results:
DB2 SQLERRP: DSN07010
DB2 VER: 07.01

-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On Behalf Of Schiradin,Roland HG-Dir itb-db/dc
Sent: Tuesday, December 07, 2004 2:56 PM
To: [login to unmask email]
Subject: Re: Get current DB2 release form REXX

James,

hmmhhh well I using the "old" offsets.

7 *-* ssid = "DB2S"
>>> "DB2S"
IRX0100I +++ Interactive trace. TRACE OFF to end debug, ENTER to contin


8 *-* Address DSNREXX "CONNECT" SSID
>>> "CONNECT DB2S"

9 *-* If SQLCODE ^= 0
>>> "0"

10 *-* say "DB2 product code = " substr(sqlerrp,1,3)", V.R.M = ",
substr(sqlerrp,3,2)'.',
substr(sqlerrp,5,2)'.'substr(sqlerrp,7,2)
>>> "DB2 product code = DSN, V.R.M = NT. ZA.LI"
DB2 product code = DSN, V.R.M = NT. ZA.LI
say sqlerrp
DSNTZALI

13 *-* SQLSTMT = ,
"SELECT PHONENO FROM DSN8610.EMP WHERE LASTNAME = 'HAAS' "
>>> "SELECT PHONENO FROM DSN8610.EMP WHERE LASTNAME = 'HAAS' "

15 *-* /* dsn_sql = "DECLARE C1 CURSOR FOR S1"
Address DSNREXX "EXECSQL" DSN_SQL
If SQLCODE ^= 0 Then Call SQLCA
Say "SQLCODE from Declare is "SQLCODE
*/
20 *-* dsn_sql = "PREPARE S1 FROM :SQLSTMT"
>>> "PREPARE S1 FROM :SQLSTMT"

21 *-* Address DSNREXX "EXECSQL" DSN_SQL
>>> "EXECSQL PREPARE S1 FROM :SQLSTMT"

22 *-* say "DB2 product code = " substr(sqlerrp,1,3)", V.R.M = ",
substr(sqlerrp,3,2)'.',
substr(sqlerrp,5,2)'.'substr(sqlerrp,7,2)
>>> "DB2 product code = DSN, V.R.M = N . . "
DB2 product code = DSN, V.R.M = N . .
say sqlerrp
DSN


Roland


-----Ursprüngliche Nachricht-----
Von: DB2 Data Base Discussion List [mailto:[login to unmask email] Im Auftrag von James Campbell
Gesendet: Dienstag, 7. Dezember 2004 23:23
An: [login to unmask email]
Betreff: Re: Get current DB2 release form REXX


One problem is that my starting positions were out. Should be ", V.R.M = "substr(sqlerrp,4,2)'.',
substr(sqlerrp,6,2)'.'substr(sqlerrp,8,1)

The other is that it appears that SQLERRP has not been assigned a value - which will happen each time execsql is invoked.

You have done the
"SUBCOM DSNREXX"
IF RC THEN S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
ADDRESS DSNREXX "CONNECT" SSID
IF SQLCODE ¬= 0 THEN /* handle error */
first, and tested SQLCODE after the "EXECSQL CONNECT" haven't you?

Currently I am not in a position to debug the code myself.

James Campbell

On Tue, 7 Dec 2004 11:26:39 -0500, Walls, Lucious G CONT (SITC) <[login to unmask email]> wrote:

>James,
>
>I took the liberty and tested the code you submitted to get the current
DB2 release from REXX. What returned from running wasn't exactly what I expected. I received the following result: "DB2 product code = SQL, V.R.M = LE.RR.P". I thought I would get a result like 7.1. which is the current DB2 release at our shop.
>
>Regards,
>
>Lucious Walls
>SPAWAR ITC (Washington)
>[login to unmask email]
>703-693-0940 DSN 223-0940
>
>-----Original Message-----
>From: DB2 Data Base Discussion List [mailto:[login to unmask email]On
>Behalf Of James Campbell
>Sent: Monday, December 06, 2004 11:18 PM
>To: [login to unmask email]
>Subject: Re: Get current DB2 release form REXX
>
>
>/* untested */
>address dsnrexx "execsql connect"
>say "DB2 product code = " substr(sqlerrp,1,3)", V.R.M = "substr
>(sqlerrp,3,2)'.',
> substr(sqlerrp,5,2)'.'substr(sqlerrp,7,2)
>
>James Campbell
>
>
>On Mon, 6 Dec 2004 09:44:33 -0600, Robin WIlloughby
><[login to unmask email]> wrote:
>
>>Can somebody suggest a straight forward way to identify which release
level
>>a DB2 subsystem is at when connected via DSNREXX from a REXX program ?
>>
>>cheers,
>>
>>Robin
>>

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Ruediger Kurtz

AW: Get current DB2 release form REXX
(in response to Charlie Kondo)
We use a different REXX/DB2-Interface here, but James' solution gets us ...

143 *-* address sql "connect"
>>> "connect"
144 *-* say "DB2 product code = " substr(sqlca.sqlerrp, 1 , 3)", V.R.M =
substr(sqlca.sqlerrp, 3 , 2)'.',
substr(sqlca.sqlerrp, 5 , 2)'.'substr(sqlca.sqlerrp, 7 , 2)
>>> "DB2 product code = DSN, V.R.M = N0. 70.10"
DB2 product code = DSN, V.R.M = N0. 70.10
147 *-* EXIT

-----Ursprüngliche Nachricht-----
Von: DB2 Data Base Discussion List [mailto:[login to unmask email]Im
Auftrag von Kondo, Charles
Gesendet: Mittwoch, 8. Dezember 2004 02:12
An: [login to unmask email]
Betreff: Re: Get current DB2 release form REXX


Try this
/* REXX
RETRIEVE SQLERRP TO FORMAT DB2 VER.REL
*/
ARG SSN
ADDRESS DSNREXX
"CONNECT "SSN
IF SQLCODE ¬= 0 THEN SAY 'ADDRESS FAILED'

ADDRESS DSNREXX "EXECSQL CONNECT"
SAY "DB2 SQLERRP:" SQLERRP /* DISPLAYS DSN07010 */
DB2V = SUBSTR(SQLERRP,4,2)
DB2R = SUBSTR(SQLERRP,6,2)
SAY 'DB2 VER:' DB2V'.'DB2R
RETURN

Results:
DB2 SQLERRP: DSN07010
DB2 VER: 07.01

-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On Behalf Of Schiradin,Roland HG-Dir itb-db/dc
Sent: Tuesday, December 07, 2004 2:56 PM
To: [login to unmask email]
Subject: Re: Get current DB2 release form REXX

James,

hmmhhh well I using the "old" offsets.

7 *-* ssid = "DB2S"
>>> "DB2S"
IRX0100I +++ Interactive trace. TRACE OFF to end debug, ENTER to contin


8 *-* Address DSNREXX "CONNECT" SSID
>>> "CONNECT DB2S"

9 *-* If SQLCODE ^= 0
>>> "0"

10 *-* say "DB2 product code = " substr(sqlerrp,1,3)", V.R.M = ",
substr(sqlerrp,3,2)'.',
substr(sqlerrp,5,2)'.'substr(sqlerrp,7,2)
>>> "DB2 product code = DSN, V.R.M = NT. ZA.LI"
DB2 product code = DSN, V.R.M = NT. ZA.LI
say sqlerrp
DSNTZALI

13 *-* SQLSTMT = ,
"SELECT PHONENO FROM DSN8610.EMP WHERE LASTNAME = 'HAAS' "
>>> "SELECT PHONENO FROM DSN8610.EMP WHERE LASTNAME = 'HAAS' "

15 *-* /* dsn_sql = "DECLARE C1 CURSOR FOR S1"
Address DSNREXX "EXECSQL" DSN_SQL
If SQLCODE ^= 0 Then Call SQLCA
Say "SQLCODE from Declare is "SQLCODE
*/
20 *-* dsn_sql = "PREPARE S1 FROM :SQLSTMT"
>>> "PREPARE S1 FROM :SQLSTMT"

21 *-* Address DSNREXX "EXECSQL" DSN_SQL
>>> "EXECSQL PREPARE S1 FROM :SQLSTMT"

22 *-* say "DB2 product code = " substr(sqlerrp,1,3)", V.R.M = ",
substr(sqlerrp,3,2)'.',
substr(sqlerrp,5,2)'.'substr(sqlerrp,7,2)
>>> "DB2 product code = DSN, V.R.M = N . . "
DB2 product code = DSN, V.R.M = N . .
say sqlerrp
DSN


Roland


-----Ursprüngliche Nachricht-----
Von: DB2 Data Base Discussion List [mailto:[login to unmask email] Im Auftrag von James Campbell
Gesendet: Dienstag, 7. Dezember 2004 23:23
An: [login to unmask email]
Betreff: Re: Get current DB2 release form REXX


One problem is that my starting positions were out. Should be ", V.R.M = "substr(sqlerrp,4,2)'.',
substr(sqlerrp,6,2)'.'substr(sqlerrp,8,1)

The other is that it appears that SQLERRP has not been assigned a value - which will happen each time execsql is invoked.

You have done the
"SUBCOM DSNREXX"
IF RC THEN S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
ADDRESS DSNREXX "CONNECT" SSID
IF SQLCODE ¬= 0 THEN /* handle error */
first, and tested SQLCODE after the "EXECSQL CONNECT" haven't you?

Currently I am not in a position to debug the code myself.

James Campbell

On Tue, 7 Dec 2004 11:26:39 -0500, Walls, Lucious G CONT (SITC) <[login to unmask email]> wrote:

>James,
>
>I took the liberty and tested the code you submitted to get the current
DB2 release from REXX. What returned from running wasn't exactly what I expected. I received the following result: "DB2 product code = SQL, V.R.M = LE.RR.P". I thought I would get a result like 7.1. which is the current DB2 release at our shop.
>
>Regards,
>
>Lucious Walls
>SPAWAR ITC (Washington)
>[login to unmask email]
>703-693-0940 DSN 223-0940
>
>-----Original Message-----
>From: DB2 Data Base Discussion List [mailto:[login to unmask email]On
>Behalf Of James Campbell
>Sent: Monday, December 06, 2004 11:18 PM
>To: [login to unmask email]
>Subject: Re: Get current DB2 release form REXX
>
>
>/* untested */
>address dsnrexx "execsql connect"
>say "DB2 product code = " substr(sqlerrp,1,3)", V.R.M = "substr
>(sqlerrp,3,2)'.',
> substr(sqlerrp,5,2)'.'substr(sqlerrp,7,2)
>
>James Campbell
>
>
>On Mon, 6 Dec 2004 09:44:33 -0600, Robin WIlloughby
><[login to unmask email]> wrote:
>
>>Can somebody suggest a straight forward way to identify which release
level
>>a DB2 subsystem is at when connected via DSNREXX from a REXX program ?
>>
>>cheers,
>>
>>Robin
>>

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Robin Willoughby

Re: AW: Get current DB2 release form REXX
(in response to Ruediger Kurtz)
Thanks Chaps,
I think Charles variation on James's suggestion holds the key - you need to
do the second CONNECT (without SSID) - the first CONNECT populates SQLERRP
with "DSNTZALI" while the second put in the expected version/release/mod
information

Cheers,

Robin

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm