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
 
Cleaning up a large table

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

New User


Joined: 04 Jun 2010
Posts: 25
Location: Pune

PostPosted: Tue Sep 16, 2014 12:49 pm    Post subject: Cleaning up a large table
Reply with quote

Hi All,
I just moved to a new work team and received a business request to clean up a large business table. The table, currently has 600 million rows and upwards. If i were to cleanup this table, would it be effective using a COBOL-DB2 program where i make use of the YEAR and QUARTER functions of DB2 ? Basically i am looking at efficient ways of cleaning up a large DB2 table using COBOL. This table was used for archiving transactions done by business. Any pointers on the same would be helpful, thanks.
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2032
Location: UK

PostPosted: Tue Sep 16, 2014 6:12 pm    Post subject: Reply to: Cleaning up a large table
Reply with quote

You coukld unload the table and use your sort program to delete the unwanted rows - assuming cleanup=delete.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1938
Location: NY,USA

PostPosted: Wed Sep 17, 2014 12:31 am    Post subject:
Reply with quote

Code:
IF It is a conditional clean up then
  take a back up and then delete by DB2 utility-additionally if you have any
 partions on date then and need to delete any specific range data then
  use a partion number while you do a delete
ELSE
 Also look for TRUNCATE.
END-IF


It is not efficient to do one by one in COBOL-DB@ program (if thats what you were asking)
Back to top
View user's profile Send private message
RedDevil711

New User


Joined: 04 Jun 2010
Posts: 25
Location: Pune

PostPosted: Wed Sep 17, 2014 1:39 pm    Post subject:
Reply with quote

Thanks for the replies Nic and Rohit.
I do have a date specific range for clean up, I will look at the option Rohit suggested based on partitions allocated based on date.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1191
Location: Bangalore,India

PostPosted: Wed Nov 05, 2014 4:02 pm    Post subject:
Reply with quote

Hello There,

You can also use REORG DISCARD option to delete the MASS data for any specific criteria.
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 SQL IN predicate using COBOL table jerryte DB2 16 Fri Jun 29, 2018 10:30 pm
No new posts How to delete large data. Mounika Nemani DB2 3 Wed Jun 13, 2018 1:58 pm
No new posts Extracting DDL for all list of intere... Ashishpanpaliya DB2 5 Mon May 21, 2018 4:08 pm
No new posts Searching a table for the field name? socker_dad COBOL Programming 8 Sat Mar 31, 2018 2:57 am
No new posts Need inputs on DB2 tablespace/table r... ashek15 DB2 3 Sat Mar 24, 2018 11:49 pm

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