I'm sorry if I overstrain your patience but I literally don't have any support and im a young student new in mainframe environment.
I have done folling REXX program:
000100 ADDRESS TSO "SUBCOM DSNREXX"
000200 IF RC=0 THEN
000300 SAY 'DSNREXX IS AVAILABLE'
000400 ELSE
000500 DO
000600 SAY 'DSNREXX IS NOT AVAILABLE'
000700 SAY 'SUBCOM RC:' RC
000800 END
000900 IF RC THEN
001000 DO
001100 S_RC=RXSUBCOM('ADD','DSNREXX','DSNREXX')
001200 SAY 'ADDING DSNREXX...............'
001300 PULL X
001400 END
001410 ADDRESS DSNREXX
001420 "CONNECT" D931
001430 "EXECSL SET CURRENT PACKAGESET ='DSNREXCS'"
001500 SQLSTMT = "SELECT * FROM PRAK405.ANGESTELLTE"
001800 "EXECSQL DECLARE C1 CURSOR FOR S1"
001900 "EXECSQL PREPARE S1 INTO :OUTSQLDA FROM :SQLSTMT"
002000 "EXECSQL OPEN C1"
002100 "EXECSQL FETCH C1 USING DESCRIPTOR :OUTSQLDA"
002110 SAY "OUTPUT" OUTSQLDA
002200 IF SQLCODE = 0 THEN
002300 DO
002400 DO I=1 TO OUTSQLDA.SQLD
002510 SAY" COLUMN NAME: "OUTSQLDA.I.SQLNAME
002530 SAY" COLUMN VALUE: "OUTSQLDA.I.SQLDATA
002540 END
002550 END
002600 "EXECSQL EXECUTE S1 USING DESCRIPTOR :OUTSQLDA"
002700 SAY SQLCODE
002800 RETURN
Now I wanted to do the same thing under REXX FOR CICS but DSNREXX isn't available.
So I tried to mimic the SQL example of this
http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/CICA1A01/2.12.2.3?DT=19940726164308000001 "EXECSQL SELECT * FROM PRAK405.ANGESTELLTE "
000002 If rc <> 0 then
000003 do
000004 Say ' '
000005 Say 'Error accessing EMPLOYEE table'
000006 Say 'RC =' rc
000007 Say 'SQLCODE =' SQLCODE
000008 Exit rc
000009 end
000010 EXIT
This is in CICIVP1 DFH310.REXX.SCICUSER,I executed it in REXX FOR CICS "call CICIVP1"
Now i guessed that this isn't working.
Enter a REXX command or EXIT to quit
CALL CICIVP1
1 *-* "EXECSQL SELECT * FROM PRAK405.ANGESTELLTE "
+++ RC(-4) +++
Error accessing EMPLOYEE table
RC = -4
SQLCODE = SQLCODE
I managed to get DB2 data out of a cobol program on cics if that is helpfull on this topic.
Please give me some hints...