Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Issue with SQLDA Structure

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
akhi007

New User


Joined: 30 Jan 2006
Posts: 35
Location: Richmond

PostPosted: Fri Sep 10, 2010 2:19 am    Post subject: Issue with SQLDA Structure
Reply with quote

Hi,

I have defined a SQLDA for calling a stored procedure which has one of the parameters as VARCHAR. SQLIND is showing values as -3856.

SQLNAME = OUT_REC
SQLTYPE = 449
SQLLEN = 32000
SQLIND = -3856
SQLDATA = djfdfdfkdnfjdfndjfndjfdfjdkfndjfdfnkjfdnfjdjffnkdfdfdj

As far as I understand SQLIND will tell us about the nature of data in SQLDATA field, whether it is null (-1) or truncated (+1) or good fetch (0)

Did anyone have insight over SQLIND parameter in SQLDA or faced these sort of issues before?

Thanks,
Akhil
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Sep 10, 2010 11:00 am    Post subject:
Reply with quote

actually, SQLIND is a pointer.

google 'SQLIND parameter in SQLDA',
and read some of the 2080 references.
Back to top
View user's profile Send private message
akhi007

New User


Joined: 30 Jan 2006
Posts: 35
Location: Richmond

PostPosted: Fri Sep 10, 2010 6:18 pm    Post subject:
Reply with quote

@ dbzTHEdinosauer :

I already googled for SQLDA structures and understood the meaning of SQLIND parameter.... I'm wondering about the weird value coming in SQLIND parameter... Ideally it should be +1, 0, -1 , -2 from the references I got from DB2 books and google.

All,

I am calling the stored procedure through REXX using SQLDA parameter. SQLDATA for varchar field gets overlapped with data from subsequent parameter.

For e.g. If my stored procedure declaration is as follows

INPUT CHAR (10)
OUTREC1 VARCHAR 32000
OUTREC2 CHAR(150)

Data from OUTREC2 is getting overlapped in OUTREC1 varchar field for first 150 bytes.

Lets say if the expected output of both parameters are

OUTREC1 = "Hello, What is your name?"
OUTREC2 = "James"

Output coming out of SQLDATA field is
OUTREC1 = "James, What is your name?"
OUTREC2 = "James"

When I call the same stored procedure through JAVA, I am getting the desired output. I would like to know if anybody have faced any issues like this before. Please help !! Thanks in advance.

Thanks,
Akhil
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Sep 10, 2010 6:57 pm    Post subject:
Reply with quote

I would suggest that your JAVA is coded correctly and your REXX is not.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Sep 10, 2010 7:19 pm    Post subject:
Reply with quote

Hello,

And if you don't post the bit of the rexx code that fails, no one here will be able to help. . .

Have you TRACEd the rexx execution?
Back to top
View user's profile Send private message
akhi007

New User


Joined: 30 Jan 2006
Posts: 35
Location: Richmond

PostPosted: Fri Sep 10, 2010 7:41 pm    Post subject:
Reply with quote

@ dbzTHEdinosauer:

REXX program is working fine for other stored procedures which does not have a VARCHAR field.

@dick scherrer

I have traced the rexx execution and everything is looking good until call. After procedure is called, SQLIND turned to a negative value -3856 and data gets overlapped with subsequent parameter data

Here is the piece of code that fails
SQLDA. = ''

SQLDA.1.SQLNAME = INREC
SQLDA.1.SQLTYPE = 453
SQLDA.1.SQLLEN = 10
SQLDA.1.SQLIND = 0

SQLDA.2.SQLNAME = OUTREC1
SQLDA.2.SQLTYPE = 449
SQLDA.2.SQLLEN = 32000
SQLDA.2.SQLIND = 0

SQLDA.3.SQLNAME = OUTREC2
SQLDA.3.SQLTYPE = 453
SQLDA.3.SQLLEN = 150
SQLDA.3.SQLIND = 0

ADDRESS DSNREXX "EXECSQL CALL SCHEMA.PROCNAME USING DESCRIPTOR :SQLDA"

IF SQLCODE = 0 THEN DO
DO I = 1 TO SQLDA.SQLD
SAY SQLDA.I.SQLNAME " = " SQLDA.I.SQLDATA
SAY "TYPE = " SQLDA.I.SQLTYPE
SAY "IND = " SQLDA.I.SQLIND
SAY "LENGTH = " SQLDA.I.SQLLEN
END
END

Two things are floating in my mind...

1) Will there be any issue with SQLDA structures supported by REXX-DB2
2) What are the possible values for SQLIND field

Hope this helps,

Thanks,
Akhil
Back to top
View user's profile Send private message
akhi007

New User


Joined: 30 Jan 2006
Posts: 35
Location: Richmond

PostPosted: Fri Sep 10, 2010 7:44 pm    Post subject:
Reply with quote

Forget to copy the initialization of SQLDATA before calling...

SQLDA.1.SQLNAME = INREC
SQLDA.1.SQLTYPE = 453
SQLDA.1.SQLLEN = 10
SQLDA.1.SQLIND = 0
SQLDA.1.SQLDATA = "input "

SQLDA.2.SQLNAME = OUTREC1
SQLDA.2.SQLTYPE = 449
SQLDA.2.SQLLEN = 32000
SQLDA.2.SQLIND = 0
SQLDA.2.SQLDATA = " "

SQLDA.3.SQLNAME = OUTREC2
SQLDA.3.SQLTYPE = 453
SQLDA.3.SQLLEN = 150
SQLDA.3.SQLIND = 0
SQLDA.3.SQLDATA = " "
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Sep 10, 2010 8:40 pm    Post subject:
Reply with quote

thx for getting back with the resolution.
Back to top
View user's profile Send private message
akhi007

New User


Joined: 30 Jan 2006
Posts: 35
Location: Richmond

PostPosted: Fri Sep 10, 2010 9:06 pm    Post subject: Reply to: Issue with SQLDA Structure
Reply with quote

@ dbzTHEdinosauer

I did not copy paste the initialize statements for SQLDATA in my earlier post.

That is why I posted it again... Issue still persists.. icon_sad.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DFHRESPONSE returns issue divated CICS 3 Wed Nov 02, 2016 6:32 pm
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm
No new posts Copybook structure in Load module Vai123 COBOL Programming 7 Fri Sep 16, 2016 8:29 pm
No new posts REXX Screen not working due to LINKED... sundarkudos CLIST & REXX 1 Mon May 09, 2016 1:44 pm
No new posts Issue in sending zip file as mail att... ajithajt JCL & VSAM 8 Thu Apr 07, 2016 9:11 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us