MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

REXX to access tables
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
kingo
Intermediate


Joined: 01 Sep 2006
Posts: 167
Topics: 40
Location: chennai

PostPosted: Tue May 08, 2007 3:31 am    Post subject: REXX to access tables Reply with quote

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
View user's profile Send private message Yahoo Messenger
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Tue May 08, 2007 3:38 am    Post subject: Reply with quote

could you post the code?
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue May 08, 2007 3:45 am    Post subject: Reply with quote

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
View user's profile Send private message
kingo
Intermediate


Joined: 01 Sep 2006
Posts: 167
Topics: 40
Location: chennai

PostPosted: Tue May 08, 2007 3:55 am    Post subject: Reply with quote

/* 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
View user's profile Send private message Yahoo Messenger
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Tue May 08, 2007 4:09 am    Post subject: Reply with quote

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
View user's profile Send private message
kingo
Intermediate


Joined: 01 Sep 2006
Posts: 167
Topics: 40
Location: chennai

PostPosted: Tue May 08, 2007 4:10 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Tue May 08, 2007 4:13 am    Post subject: Reply with quote

now, you should talk with your dba/systemers about DSNREXX

Do you have HILITE on? it helps you to find the quote mismatching easily.

Wink
Back to top
View user's profile Send private message
kingo
Intermediate


Joined: 01 Sep 2006
Posts: 167
Topics: 40
Location: chennai

PostPosted: Tue May 08, 2007 4:13 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue May 08, 2007 4:17 am    Post subject: Reply with quote

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
View user's profile Send private message
kingo
Intermediate


Joined: 01 Sep 2006
Posts: 167
Topics: 40
Location: chennai

PostPosted: Tue May 08, 2007 4:31 am    Post subject: Reply with quote

So how would I fix it?

Regds,
Kingo
_________________
IF YOU ARE NOT FOCUSSED ON GOAL ALL YOU SEE IS OBSTACLE.
Back to top
View user's profile Send private message Yahoo Messenger
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Tue May 08, 2007 4:32 am    Post subject: Reply with quote

Nic Clouston wrote:
You RETURN from a sub-routine e.g. SQLCA (which is a bad name for a sub-routine)


it's in the examples in the document
ftp://ftp.software.ibm.com/software/os390/db2server/books/REXXV5.PDF
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue May 08, 2007 4:49 am    Post subject: Reply with quote

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
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue May 08, 2007 4:54 am    Post subject: Reply with quote

Quote:

you have not done a preparea dn

I should follow my own advice and preview my posts Exclamation
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
View user's profile Send private message
kingo
Intermediate


Joined: 01 Sep 2006
Posts: 167
Topics: 40
Location: chennai

PostPosted: Tue May 08, 2007 6:00 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue May 08, 2007 6:17 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group