Db2 11 for z/OS REXX and GET DIAGNOSTICS

Daniel Luksetich

Db2 11 for z/OS REXX and GET DIAGNOSTICS
Has anyone ever gotten GET DIAGNOSTICS to work in a REXX program? I'm
trying, but getting a SQLCODE -312.

Thanks,

Dan



Daniel L Luksetich

DanL Database Consulting



IBM GOLD Consultant

IBM Champion for Analytics

IDUG Content Committee Past-Chairman

IBM Certified Database Adminstrator - DB2 11 DBA for z/OS

IBM Certified System Administrator - DB2 11 for z/OS

IBM Certified Application Developer - DB2 11 for z/OS

IBM Certified Advanced Database Administrator - DB2 10.1 for Linux UNIX and
Windows



Sam Baugh

Db2 11 for z/OS REXX and GET DIAGNOSTICS
(in response to Daniel Luksetich)
Does not appear to be possible, google found a few references to it not
being supported, such as 2009 IDUG presentation called "DB2 and the Joy of
REXX". I had attempted before and get the same error, where it doesn't
recognize the variable (DB2 11 z/OS).

On Tue, Dec 12, 2017 at 9:36 AM, Daniel L Luksetich <[login to unmask email]>
wrote:

> Has anyone ever gotten GET DIAGNOSTICS to work in a REXX program? I’m
> trying, but getting a SQLCODE -312.
>
> Thanks,
>
> Dan
>
>
>
> Daniel L Luksetich
>
> DanL Database Consulting
>
>
>
> IBM GOLD Consultant
>
> IBM Champion for Analytics
>
> IDUG Content Committee Past-Chairman
>
> IBM Certified Database Adminstrator – DB2 11 DBA for z/OS
>
> IBM Certified System Administrator – DB2 11 for z/OS
>
> IBM Certified Application Developer – DB2 11 for z/OS
>
> IBM Certified Advanced Database Administrator – DB2 10.1 for Linux UNIX
> and Windows
>
>
>
> -----End Original Message-----
>

James Campbell

RE: Db2 11 for z/OS REXX and GET DIAGNOSTICS
(in response to Daniel Luksetich)

vote for https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=28491

 

James Campbell

James Campbell

RE: Db2 11 for z/OS REXX and GET DIAGNOSTICS
(in response to Daniel Luksetich)

I have kludged up a working implementation.

The secret is that the diagnostics returned are from the previous (non GET DIAGNOSTICS) statement - which is not necessarily from the same program/package.  So I have written a little GETDIAG program that takes a parameter for the type of diagnostics wanted, issues the appropriate GET DIAGNOSTICS, and returns the diagnostics string (along with SQLCODE and error message, if any).  The REXX code uses LINKPGM to invoke GETDIAG and I now, errors permitting, have the diagnostics string in my REXX code.

The one thing I haven't been able to get working is setting CURRENT PACKAGESET in the REXX code so that GETDIAG's package is located.  In the end I rebound the DSNREXX plan so that GETDIAG's collection is included in the PKLIST.

 

James Campbell