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 

Problem after ALLOCATE

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
HB0
Beginner


Joined: 20 Apr 2005
Posts: 25
Topics: 7

PostPosted: Fri Oct 10, 2008 8:26 am    Post subject: Problem after ALLOCATE Reply with quote

We have a statement -
EXEC SQL
ALLOCATE D1 CURSOR FOR RESULT SET :AW-LOCATOR
END-EXEC.


After this we have the EVALUATE SQLNAMEC statement.
The cursor name used in the DECLARE statement is CUSTOMERACCOUNT,
whereas SQLNAMEC is returning CUSTOMERACCOUNT...... where .... is Lowvalues for the remaining 15 bytes after the cursor name.
Hence the control in EVALUATE SQLNAMEC
WHEN 'CUSTOMERACCOUNT'
PERFORM PROCESS-FETCH-CUSTOMERACCOUNT
WHEN OTHER
PERFROM ABEND-PARA is getting into other and abending.

I ahven't worked on stored procedures and unable to understand why it is returning low values in this field. We had a DB2 V8 upgrade and this started happening after that. Can we attribute this to that ? We have a temporary workaround for this, but why did this happen and what is a possible permanent solution. The SQLNAMEL field which gives the length of the cursor I believe it returning the total 30 bytes of SQLNAMEC field as length ,irrespective of the cursor length. Appreciate your inputs.


HB0.
Back to top
View user's profile Send private message
jsharon1248
Intermediate


Joined: 08 Aug 2007
Posts: 291
Topics: 2
Location: Chicago

PostPosted: Wed Oct 15, 2008 1:48 pm    Post subject: Reply with quote

The SQLDA text fields are defined as VARCHAR. I don't think you can depend on values beyond the length that DB2 returns for each field. Try

Code:
EVALUATE SQLNAMEC(1:SQLNAMEL)


It's possible that IBM changed the way they populate the SQLNAMEC field. I reviewed a pgm I coded for v7, and the pgm is coded as if DB2 would space fill the remainder of the field after the name. I don't have access to v7, so I can't tell for sure.

Incidently, I'm wondering how you're aquiring storage. I didn't like IBM's sample pgm. I wound up using LE services to dynamically aquire storage which I thought simplified the coding and provided more flexibility.
Back to top
View user's profile Send private message
HB0
Beginner


Joined: 20 Apr 2005
Posts: 25
Topics: 7

PostPosted: Fri Oct 17, 2008 12:25 am    Post subject: Reply with quote

Thanks Sharon. But I am unable to find any instances of this sort on teh net to confirm that this could be and upgrade issue.
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 -> Database All times are GMT - 5 Hours
Page 1 of 1

 
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