View previous topic :: View next topic |
Author |
Message |
kingo Intermediate
Joined: 01 Sep 2006 Posts: 167 Topics: 40 Location: chennai
|
Posted: Tue May 08, 2007 3:31 am Post subject: REXX to access tables |
|
|
Hi,
I am trying to write a small REXX program to access a table.Where I face a problem in calling subprogram.
Error message :
IKJ56532I STMT 34 - LABEL SQLCA SPECIFIED BUT COMMAND NOT FOUND
This is the error message i get.
Regds,
Kingo _________________ IF YOU ARE NOT FOCUSSED ON GOAL ALL YOU SEE IS OBSTACLE. |
|
Back to top |
|
|
acevedo Beginner
Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Tue May 08, 2007 3:38 am Post subject: |
|
|
could you post the code? |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Tue May 08, 2007 3:45 am Post subject: |
|
|
From quickref, and I assume the manual,
Quote: |
IKJ56532I STMT num - LABEL name SPECIFIED BUT COMMAND NOT FOUND
Explanation: The statement numbered "num" contained a label specified as
"name" but no command name.
Audience: EXEC user
Detected by: IKJCT432 |
What does line 34 say? Have you tried it with trace on (trace '?i')? What did that reveal? What else have you done to try and resolve it?
Without knowing what the statement is we have no idea. I would think you have mis-typed something but it may be that you have not done something prior to this point? Post your code upt ot this point (and remember to use [ code ][ /code ] tags and preview it _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
kingo Intermediate
Joined: 01 Sep 2006 Posts: 167 Topics: 40 Location: chennai
|
Posted: Tue May 08, 2007 3:55 am Post subject: |
|
|
/* REXX */
SUBSYS = xxxx
SQLSTMT1 = "SELECT EMP_ID,EMP_NO",
"FROM yyyy.TABSTU5"
ADDRESS TSO "SUBCOM DSNREXX"
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
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 'I AM INSIDE SQLCA'
SAY "SQLCODE = " SQLCODE
SAY "SQLSTATE = " SQLSTATE
SAY "SQLERRMC = " SQLERRMC
EXIT _________________ IF YOU ARE NOT FOCUSSED ON GOAL ALL YOU SEE IS OBSTACLE. |
|
Back to top |
|
|
acevedo Beginner
Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Tue May 08, 2007 4:09 am Post subject: |
|
|
if it's not a typo I miss a quote at the end of
ADDRESS DSNREXX "EXECSQL FETCH C1 USING DESCRIPTOR :OUTSQLDA" |
|
Back to top |
|
|
kingo Intermediate
Joined: 01 Sep 2006 Posts: 167 Topics: 40 Location: chennai
|
Posted: Tue May 08, 2007 4:10 am Post subject: |
|
|
I got it fixed but i am getting -805 as error message.
Regds,
Kingo _________________ IF YOU ARE NOT FOCUSSED ON GOAL ALL YOU SEE IS OBSTACLE. |
|
Back to top |
|
|
acevedo Beginner
Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Tue May 08, 2007 4:13 am Post subject: |
|
|
now, you should talk with your dba/systemers about DSNREXX
Do you have HILITE on? it helps you to find the quote mismatching easily.
|
|
Back to top |
|
|
kingo Intermediate
Joined: 01 Sep 2006 Posts: 167 Topics: 40 Location: chennai
|
Posted: Tue May 08, 2007 4:13 am Post subject: |
|
|
I AM INSIDE MESS
SQLCODE = -805
SQLSTATE = 51002
SQLERRMC = xxxx..DSNREXX.179B1B801EC66B11:DSNREXX:03
this is the error message i get
Regds,
Kingo _________________ IF YOU ARE NOT FOCUSSED ON GOAL ALL YOU SEE IS OBSTACLE. |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Tue May 08, 2007 4:17 am Post subject: |
|
|
you have not done a preparea dn where are you getting your -805? we are not psychic - we cannot see your screen - we only see what you type here. And can you PLEASE use code tags so that your code is easy to read. Also you EXIT from a script, you do not RETURN from it. You RETURN from a sub-routine e.g. SQLCA (which is a bad name for a sub-routine) _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
kingo Intermediate
Joined: 01 Sep 2006 Posts: 167 Topics: 40 Location: chennai
|
Posted: Tue May 08, 2007 4:31 am Post subject: |
|
|
So how would I fix it?
Regds,
Kingo _________________ IF YOU ARE NOT FOCUSSED ON GOAL ALL YOU SEE IS OBSTACLE. |
|
Back to top |
|
|
acevedo Beginner
Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Tue May 08, 2007 4:49 am Post subject: |
|
|
acevedo
Thanks for that link - I usually just use the main manual. This is better - I hope (I'll read it tonight)....but... it is still a bad name - I'd go with something more like DISPLAY_DIAGNOSTICS.
Kingo,
Read acevedo's link and ensure you have coded all the necessary steps. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Tue May 08, 2007 4:54 am Post subject: |
|
|
Quote: |
you have not done a preparea dn
|
I should follow my own advice and preview my posts
I think this should read
Quote: | You have not done a PREPARE. |
Quote: |
So how would I fix it?
|
I do not know as I do not know where it failed.
Anyway, try following the document and see if you fix it yourself first. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
kingo Intermediate
Joined: 01 Sep 2006 Posts: 167 Topics: 40 Location: chennai
|
Posted: Tue May 08, 2007 6:00 am Post subject: |
|
|
I checked through those docs and my code adheared to the same code and standards.But still i get that -805.
Regds,
Kingo _________________ IF YOU ARE NOT FOCUSSED ON GOAL ALL YOU SEE IS OBSTACLE. |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Tue May 08, 2007 6:17 am Post subject: |
|
|
Well, as posted, your code does not have a PREPARE statement e.g.
Code: |
Address DSNREXX 'EXECSQL PREPARE S1 FROM :sqlstmt';
or
'EXECSQL PREPARE S1 INTO :outsqlda FROM :sqlstmt';
|
_________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
|
|