Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Rexx to talk to DB2.... 3

Status
Not open for further replies.

DXS

Programmer
Mar 3, 2003
8
US
I'm relatively new to REXX, but not to DB2. I have allocated my DB2 loadlib in my profile, but I keep getting this error message when I attempt to connect to DB2.

IRX0562E Abnormal completion of the READ Data Management macro.
IRX0565E GP4DXS ,$IMSDBA ,96CF,D,SYSEXEC ,READ ,WRNG.LEN.RECORD,00000B1A000C1
9,BPAM.
***
Has anyone else had a similar problem. I can run REXXs in a batch environment, but I have the loadlib specified in the steplib.

Thanks in advance,
-dxs
 
Sorry, I left of a line of the error message.

IRX0562E Abnormal completion of the READ Data Management macro.
IRX0565E GP4DXS ,$IMSDBA ,96CF,D,SYSEXEC ,READ ,WRNG.LEN.RECORD,00000B1A000C1
9,BPAM.
17 +++ S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
IRX0043I Error running DB2UNLD, line 17: Routine not found
***
-dxs
 
What platform? Are you in OS/2?



Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
It's Z/os. Version 7 of DB2.

-dxs
 
I use REXX DB2 on z/OS without problems.

You mentioned the STEPLIB so I assume you're using REXX in a batch-job.

My JCL looks like this:
[tt]
//STEP1 EXEC PGM=IKJEFT01,PARM='REXXDB2'
//STEPLIB DD DISP=SHR,DSN=TEST.LM
// DD DISP=SHR,DSN=PROD.LM
// DD DISP=SHR,DSN=DBNT.DSNLOAD
// DD DISP=SHR,DSN=DBNT.DSNEXIT
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD DUMMY
//SYSTSPRT DD SYSOUT=*
//SYSEXEC DD DSN=USER.TEST.REXX,DISP=SHR
[/tt]

and the REXX-Statements:
[tt]
/* REXX */
SUBSYS = DBNT
SQLSTMT1 = "SELECT USER_ID, NAME",
"FROM abc.table",
"WHERE NAME LIKE 'A%'"

ADDRESS TSO "SUBCOM DSNREXX" /* HOST CMD ENV AVAILABLE ? */
IF RC THEN S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')

ADDRESS DSNREXX "CONNECT" SUBSYS
IF SQLCODE ^= 0 THEN CALL SQLCA

ADDRESS DSNREXX "EXECSQL DECLARE C1 CURSOR FOR S1"
IF SQLCODE ^= 0 THEN CALL SQLCA

ADDRESS DSNREXX "EXECSQL PREPARE S1 FROM :SQLSTMT1"
IF SQLCODE ^= 0 THEN CALL SQLCA

ADDRESS DSNREXX "EXECSQL DESCRIBE S1 INTO :OUTSQLDA"
IF SQLCODE ^= 0 THEN CALL SQLCA

ADDRESS DSNREXX "EXECSQL OPEN C1"
IF SQLCODE ^= 0 THEN CALL SQLCA

DO UNTIL(SQLCODE ^= 0)
ADDRESS DSNREXX "EXECSQL FETCH C1 USING DESCRIPTOR :OUTSQLDA"
IF SQLCODE = 0 THEN
DO
DO I = 1 TO OUTSQLDA.SQLD
SAY " > COLUMN NUMBER: " I
SAY " COLUMN NAME: " OUTSQLDA.I.SQLNAME
SAY " COLUMN TYPE: " OUTSQLDA.I.SQLTYPE
SAY " COLUMN VALUE: " OUTSQLDA.I.SQLDATA
END
END
END
RETURN

SQLCA:
SAY "SQLCODE = " SQLCODE
SAY "SQLSTATE = " SQLSTATE
SAY "SQLERRMC = " SQLERRMC
EXIT
[/tt]

Compare this example to your REXX or try it in your enviroment.

Regards,
Thomas
 
I'm sorry. I should have clarified more. I have batch REXX/DB2 working. I'm actually getting the error when running running the REXX/DB2 online (foreground).

Thanks,
-dxs
 
Then you have to allocate the DSNLOAD to your ISPLLIB:

[tt]
ADDRESS TSO
"CD FI(ISPLLIB) DA('DBNT.DSNLOAD')"
[/tt]

Regards,
Thomas
 
I tried it. Now I'm getting...

Info error on 'FI(ISPLLIB)' - RC=16
Reason : DATA SET NOT CATALOGUED. THE LOCATE MACRO RETURN CODE IS 0008

The message made me think that my dataset didn't exist, but it does. I checked for a typo, but there was none.

The next thing I started to research was the ISPSTART command. Do I need to have this inside of my online REXX or is this only for BATCH environments? Is there a different way to issue a DB2 REXX command besides 'TSO rexxname'?

Thanks,
-dxs

 
Hmmm...

First of all two questions:
1) Do you use a PREFIX and if YES did you write the filename in quotes '...'?

2) Where do you use the ISPSTART-Command? Do you invoke ISPF-Funktions or -Panels?

It should be working when you start a REXX with 'TSO rexxname'.

Try 'TSO ISRDDN' and look at your ISPLLIB. Do you find your DSNLOAD there?

Regards,
Thomas
 
I did a 'TSO ISRDDN' found that my DSNLOAD dataset was not there. I then did an 'ISP Libdef' statement.

Now I'm getting this...
ISPS102

Invalid service name
'DSN' is not a recognized dialog service name.
Current dialog statement:
DSN SYSTEM(T10D)
I'm not sure why it's not recognizing the call to the DB2 subsytem, but I'm looking through some manuals now. Hopefully I find an answer.

Thanks again everyone,
-dxs







 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top