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

LOAD utility REPLACE option


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Musab Ahmed

New User


Joined: 10 Dec 2012
Posts: 37
Location: India

PostPosted: Wed Feb 27, 2013 5:59 pm
Reply with quote

HI All,

There is a production job which uses LOAD utility to load a table. It is as follows.

LOAD DATA
REPLACE COPYDDN (COPY01)
STATISTICS TABLE (ALL) INDEX (ALL) UPDATE ALL
LOG NO
SORTKEYS 900000 SORTDEVT SYSDA
DISCARDS 0
INTO TABLE DB2FS001.TFSA092_UPC_HIER
(

I know that LOAD REPLACE statement would first delete any existing row and replaces the data with the new data.

I just want to know when the existing rows are deleted, will the space occupied by the rows also get freed up or should a reorg is to be performed to free the space?
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Wed Feb 27, 2013 11:48 pm
Reply with quote

read manuals icon_smile.gif
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Thu Feb 28, 2013 10:19 am
Reply with quote

Hi Musab,

Welcome to IBMMAINFRAMES!

When you do a LOAD REPLACE, db2 will redefine the dataset itself, so space occupied by the existing rows will be gone along with the dataset. For DB2 to do that below conditions should be satisified.
1) Tablespace should have been created in DB2 managed storage groups.
2) REUSE option should not be used.

Regards,
Sushanth
Back to top
View user's profile Send private message
Musab Ahmed

New User


Joined: 10 Dec 2012
Posts: 37
Location: India

PostPosted: Thu Feb 28, 2013 11:02 am
Reply with quote

Hi Sushanth,

Sorry for my ignorance, but what do you actually mean by

"space occupied by the existing rows will be gone along with the dataset"

Does this mean the space will be re-utilized for the new LOAD statement?
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Thu Feb 28, 2013 11:51 am
Reply with quote

Hi Musab,

icon_smile.gif

redefine = delete the existing dataset -> create new dataset

So, i said
Quote:
When you do a LOAD REPLACE, db2 will redefine the dataset itself, so space occupied by the existing rows will be gone along with the dataset.

Since rows will be loaded to new dataset

Thanks,
Sushanth
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts How to load to DB2 with column level ... DB2 6
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top