Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to get count from the delete query in cobol-db2 pgm?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
rahulcherekar

New User


Joined: 20 Feb 2007
Posts: 16
Location: New York

PostPosted: Tue Oct 20, 2009 2:24 am    Post subject: How to get count from the delete query in cobol-db2 pgm?
Reply with quote

Hi,

I have an account file. I need to delete rows corresponding to each account read from the 2 diff tables.

Steps performed in COBOL-DB2 program are:

step 1: read account file
step 2: perform delete until end of file
step 2a: delete rows for accountn from table1
step 2b: delete rows for accountn from table2
step 2c: read account file

Now, I want to display total count for number of records deleted.

One solution, is to perform select count(*) followed by delete for table1 and table2 respectively. Doing so I have to make 4 db2 calls for each account.

I remember spufing the delete query gives the count. Is there any variable which stores this count, which I can use to get the total count?

Thanks,
Rahul.
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: Tue Oct 20, 2009 2:38 am    Post subject:
Reply with quote

Hello,

SQLERRD(3) will have the number of rows deleted after each DELETE is executed.
Back to top
View user's profile Send private message
Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Tue Oct 20, 2009 11:34 am    Post subject:
Reply with quote

Get dignostic will also work
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us