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
 

 

Impact of SQL error -354 on ROWSET

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

New User


Joined: 05 Jun 2013
Posts: 5
Location: Mumbai, India

PostPosted: Tue Oct 22, 2013 11:28 pm    Post subject: Impact of SQL error -354 on ROWSET
Reply with quote

Hello all,

We have an application code (cobol-db2 program) which purges data from a db2 table

High level Flow
- Rows to be deleted are Multi-fetched (200 rows at a time)
- Records moved to file
- Records deleted from table using the ROW-SET position
- Repeat step 1,2,3 until no records found for the purge conditions defined
===============================================
During testing in some instances we were facing SQLCODE -354 while multifetch and program abend

On checking explanation for the SQLCODE learnt its most often on warning conditions such errors are seen

Extract:
"DB2 processed the statement successfully, but with at least one
non-terminating error. Additionally, the fetching of some rows might have encountered warnings."

hence we changed logic a bit so that it will proceed to delete the records on SQLCODE zero & -354

Now the program executed the multifetch statement and went on to delete 200 records but it failed with SQLCODE -508

could some body be able to provide some insights on whether -354 error causes the Cursor ROWSET to change which is what the -508 error code states

Note: We are further investigating the cause of -354 error

Thank you
Back to top
View user's profile Send private message

GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Wed Oct 23, 2013 12:10 pm    Post subject:
Reply with quote

Code:
GET DIAGNOSTICS :num_rows = ROW_COUNT, :num_cond = NUMBER
for n = 1 to num_cond
   GET DIAGNOSTICS CONDITION n :sqlstate = RETURNED_SQLSTATE, :sqlcode = DB2_RETURNED_SQLCODE, :row_num = DB2_ROW_NUMBER
   display ...
end-for

should give you an idea
Back to top
View user's profile Send private message
ajayhegdemainframe

New User


Joined: 05 Jun 2013
Posts: 5
Location: Mumbai, India

PostPosted: Wed Oct 23, 2013 12:40 pm    Post subject:
Reply with quote

Thanks GuyC, Will check on the diagnostics details to gain further info on the nature of error

fyi
The -354 error got resolved,The table had certain fields of MBCS nature ( as per SYSIBM.SYSCOLUMNS its CCSID 1208) ,hence declared respective host variables with CCSID 1208 in working storage section

Now purge job works fine

Thanks
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 DB2 Program abending without giving a... rahulgarg14 DB2 3 Mon May 29, 2017 8:10 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts IDC2902I Error tzeche ABENDS & Debugging 2 Tue Mar 28, 2017 11:39 am
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm


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