IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Cleaning up a large table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 2455
Location: Hampshire, UK

PostPosted: Tue Sep 16, 2014 6:12 pm
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

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Wed Sep 17, 2014 12:31 am
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
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: 1208
Location: Bangalore,India

PostPosted: Wed Nov 05, 2014 4:02 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top