Delete of not-used hash-files

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
vera
Participant
Posts: 4
Joined: Thu Jun 19, 2008 1:22 am

Delete of not-used hash-files

Post by vera »

Hello.
We would like to delete all not-used hash-files. Please advise how we can get a list of all these files and how we can delete them.
ray.wurlod
Participant
Posts: 54582
Joined: Wed Oct 23, 2002 10:52 pm

Post by ray.wurlod »

Define "not used". This may be trickier than you imagine. For example you may have one or two hashed files used only in end of year processing.

Once you have identified them, deleting them is straightforward, but you must use the correct method depending on how they were created.
    If they were created with a hashed file stage in an account or with a CREATE.FILE command, the correct deletion method is a DELETE.FILE command at TCL.

    If they were created with a hashed file stage in a directory or with the mkdbfile command, the correct deletion method is two rm (UNIX) or del (DOS) commands, one for the data portion and one for the dictionary portion.

    If they were created with a UniVerse stage or a CREATE TABLE statement, the correct command is DROP TABLE executed at TCL.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vera
Participant
Posts: 4
Joined: Thu Jun 19, 2008 1:22 am

Post by vera »

May be you know how can we get a list of all hash-files and how can we delete several files by one command?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am

Post by ArndW »

Check out this post for one way to do this.
<a href=http://www.worldcommunitygrid.org/team/viewTeamInfo.do?teamId=TZ9H4CGVP1 target="WCGWin">
Image</a>
daignault
Premium Member
Premium Member
Posts: 165
Joined: Tue Mar 30, 2004 2:44 pm

Post by daignault »

There is an indexing program called SMART-TS, Datastage version that will consume a DSX file and would be able to show where specific instances of a hashed file are used.

You can find more information at http://www.strategies4data.com/products ... oducts.htm

Ray Daignault
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm

Post by chulett »

As would Chuck Smith's 'list all files and tables' tool, especially if you stage up the results in a database table.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54582
Joined: Wed Oct 23, 2002 10:52 pm

Post by ray.wurlod »

Do any of these tools find hashed files whose name is a job parameter?

Another utility (on Windows only) is uvwalk with the -uvfile option; it can recursively traverse a directory structure reporting which files are hashed files and which are not.

usage: uvwalk [path] {-name filename} {-recurse} {-all} {-ntfs} {-uvfile}
[path] directory to start walking
{-name filename} filename to locate
{-recurse} recurse subdirectories
{-relative} display relative paths
{-prefix text} display located files prefixed with text
{-all} walk all logical drives
{-ntfs} NTFS partitions only
{-uvfile} execute UVfile -s to identify hashed files
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54582
Joined: Wed Oct 23, 2002 10:52 pm

Post by ray.wurlod »

A UNIX equivalent would be find path -exec UVfile {}\;

The UVfile command is in the DataStage engine bin directory.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply