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
 

 

Getting an SQLCODE of +354

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

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Wed Nov 26, 2008 11:34 am    Post subject: Getting an SQLCODE of +354
Reply with quote

Hi all,

I am getting an SQLCODE of +354 while multi fetching rows from a DB2 table. I've verified that the following things are proper.
1. datatypes of host variables matching with columns of the table
2. order of the host variables in INTO clause same as SELECT in cursor declaration
3. all null indicators are taken into account in the INTO clause.

I've used the get diagnostics statement and it is returning return_code = 0.

P.S. ROW_COUNT is not working for me here. icon_sad.gif

Can someone please tell me if I am unaware of any other possible causes icon_question.gif
Back to top
View user's profile Send private message

Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Wed Nov 26, 2008 11:43 am    Post subject:
Reply with quote

Hi all,

The problem is solved. That was due to the naming of the null indicator variable in cobol.

If the host variable name is HOST-VAR-COL then the name of the null indicator should be HOST-VAR-COL-NULL. That solved the problem.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Nov 26, 2008 2:08 pm    Post subject:
Reply with quote

Quote:

If the host variable name is HOST-VAR-COL then the name of the null indicator should be HOST-VAR-COL-NULL


that is not true

you do need to follow rules of syntax.

glad your problem is fixed, but I doubt if you know what the problem was
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Wed Nov 26, 2008 2:36 pm    Post subject:
Reply with quote

[quote=dbzTHEdinosauer]that is not true[/quote]

But that was the only modification made to the program. It was suggested by a peer who had solved it the same way long back.
The table data is still the same. The query was working in SPUFI before solving +354 and after(If I may say) solving.

Can you pls elaborate more on your doubt? Have you ever coded something like I did and got away with it? icon_razz.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Nov 26, 2008 3:20 pm    Post subject:
Reply with quote

1. you have not posted your SQL.

2. there is no requirement that the reference name for the null indicator be based on the reference name of the host variable receiving the row data.

3. you have/had something incorrect with your syntax if you received a 0 sql from the get diagnostics. rowcount should work if you provided a proper host variable.


without seeing your code, there is nothing I can add. I don't get away with things with DB2. I code according to syntax and suprise, suprise, I get my results.

Sorry, anyone who would buy (or sell) the BS that a null indicator needs to be named similarly to the host varible has a low level of db2 understanding.
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Wed Nov 26, 2008 4:02 pm    Post subject:
Reply with quote

dbzTHEdinosauer wrote:
I don't get away with things with DB2. I code according to syntax and suprise, suprise, I get my results.

I did not mean to offend you.

Quote:
Sorry, anyone who would buy (or sell) the BS that a null indicator needs to be named similarly to the host varible has a low level of db2 understanding


You said this about the best we have. icon_exclaim.gif

No more statements/comments from me......
Back to top
View user's profile Send private message
Suresh Ponnusamy

Active User


Joined: 22 Feb 2008
Posts: 107
Location: New York

PostPosted: Wed Nov 26, 2008 8:56 pm    Post subject:
Reply with quote

Hi

From SQLCODE,

Quote:

+354 A ROWSET FETCH STATEMENT MAY HAVE RETURNED ONE OR MORE ROWS OF DATA. HOWEVER, ONE OR MORE WARNING CONDITIONS WERE ALSO ENCOUNTERED. USE THE GET DIAGNOSTICS STATEMENT FOR MORE INFORMATION REGARDING THE CONDITIONS
THAT WERE ENCOUNTERED

Attention: It is also possible that an end of data condition was detected.
SQLERRD3 and GET DIAGNOSTICS can be used to determine if all of the
requested rows were fetched or if a partial rowset was returned.


We have also encountered similar condition when we have FETCH having ROWSET in one of our programs.

Please find the above description. (Attention part)

If the ROWSET is defined for 50 rows and if we are having only 10 rows in the table then we would be getting the above SQLCODE, it is not an error and is a warning message.

In our shop, For both SQLCODE 0 and 354, we will continue and move the host variable values to the array.

Hope this helps,
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Thu Nov 27, 2008 9:20 am    Post subject:
Reply with quote

Suresh Ponnusamy wrote:
If the ROWSET is defined for 50 rows and if we are having only 10 rows in the table then we would be getting the above SQLCODE,


This may not be true. Because we define ROWSET size as 1000 and use Multi-Fetch even if the query returns 2 rows. But +354 is not ususal for us.

Quote:
In our shop, For both SQLCODE 0 and 354, we will continue and move the host variable values to the array


In that case I think you will be missing some data which might exist in the table. Have you got a chance to verify the number of rows returned in the program and the number of rows returned while running in SPUFI?
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: Thu Nov 27, 2008 10:07 am    Post subject:
Reply with quote

Hello,

Quote:
You said this about the best we have.
Even the best at some place will not know everything. They do probably know a way to get a certain ("thing") done and follow the same mechanics each time they do this.

You might ask for the reference to the coding rule you learned about. It may be something implemented locally as standards envorcement.

If you post the problem definition and the code that needed work, we will be able to offer better suggestions.
Back to top
View user's profile Send private message
Suresh Ponnusamy

Active User


Joined: 22 Feb 2008
Posts: 107
Location: New York

PostPosted: Thu Dec 04, 2008 12:19 am    Post subject:
Reply with quote

Hi Bharath

We have the above (Moving to the array for both SQLCODE = 0 and +354) in all our programs and they are batch programs running everyday and we did not encountered any problems till today
.
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 SQLCODE-000000080N priya91 DB2 1 Mon Feb 01, 2016 4:35 pm
No new posts Need to understand SQLCODE = 12 rohanthengal DB2 3 Thu Nov 05, 2015 11:22 am
No new posts SQLCODE -922 in Batch-Cics program tr... kishpra CICS 2 Thu Sep 10, 2015 12:36 pm
No new posts SQLCODE -450 for stored procedure spoorni DB2 3 Fri Jan 16, 2015 2:45 am
No new posts -81 SQLCODE returned when Remote Stor... kameswaramanoj.Akella DB2 1 Wed Dec 03, 2014 5:36 am


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