IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Issue with SQLDA Structure


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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
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

Moderator Emeritus


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

PostPosted: Fri Sep 10, 2010 7:19 pm
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts Facing ABM3 issue! CICS 3
No new posts Panvalet - 9 Character name - Issue c... CA Products 6
No new posts Issue with EXEC CICS QUERY SECURITY c... CICS 6
Search our Forums:

Back to Top