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 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: 1868
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: 1783
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: 1187
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 Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts PC (UTF-8) -> z/OS (EBCDIC) -> ... prino All Other Mainframe Topics 4 Fri Sep 01, 2017 1:47 am
No new posts Adding a userid to SMTP Security table Yolanda Harvey JCL & VSAM 1 Sun Aug 13, 2017 6:16 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm

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