CLEAR.FILE

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
cecilia
Participant
Posts: 33
Joined: Thu Jan 15, 2004 9:55 am
Location: Argentina
Contact:

CLEAR.FILE

Post by cecilia »

Hi
I have the recomendation of use CLEAR.FILE &PH& as projects maintenance.
I have 3 questions about this:
1. Has this command the same efect than delete "manually" all files in &PH& directory? or does it make something else?

2. If the answer to 1 is that it does something else, how could I know it finished OK?

3. I found in this foro the following recomendation "regularly clear the contents of the &PH& and &SAVEDLISTS& directories and the directory whose pathname is recorded against the UVTEMP configuration parameter. That's about the only maintenance required at the UNIX level."
Does it apply to Windows environment too? I guess yes, but does it mean I have to include a "CLEAR.FLE &SAVEDLISTS&" and so on?

Thanks in advance, Cecilia
sivatallapaneni
Participant
Posts: 53
Joined: Wed Nov 05, 2003 8:36 am

Post by sivatallapaneni »

Hi,
I dont think CLEAR.FILE deletes any thing, it only clears the contents of the file i guess. With my limited knowledge on this topic But i checked the Basic manual here is what it says

Code: Select all

Use the CLEARFILE statement to delete all records in an open dictionary or data
file. You cannot use this statement to delete the file itself. Each file to be cleared
must be specified in a separate CLEARFILE statement.
Siva.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Re: CLEAR.FILE

Post by kcbland »

cecilia wrote:1. Has this command the same efect than delete "manually" all files in &PH& directory?
Yes
cecilia wrote: 3. I found in this foro the following recomendation "regularly clear the contents of the &PH& and &SAVEDLISTS& directories and the directory whose pathname is recorded against the UVTEMP configuration parameter. That's about the only maintenance required at the UNIX level."
Does it apply to Windows environment too?
Yes
cecilia wrote: I guess yes, but does it mean I have to include a "CLEAR.FLE &SAVEDLISTS&" and so on?
Yes
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

sivatallapaneni wrote:Hi,
I dont think CLEAR.FILE deletes any thing, it only clears the contents of the file i guess. With my limited knowledge on this topic But i checked the Basic manual here is what it says
The &PH& directory is not a hashed file. It is of a type whereby all records in that "file" are really files in a directory. Clearing the &PH& can be just as easily accomplished using a Unix rm statement or a DOS erase/del.

Notice that the rows (really files) are text viewable, not binary files.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
cecilia
Participant
Posts: 33
Joined: Thu Jan 15, 2004 9:55 am
Location: Argentina
Contact:

Post by cecilia »

Thanks a lot for the reply.

Keneth, I have a doubt yet: when I run CLEAR.FILE &PH& the file .uvnlsmap remains in the directory, in that way it's a bit different from delete all files manually. I guess it doesn't matter if .uvnlsmap exist or not, it will be recreated when a job run again, Am I right?

And taking advantage of your good will, a couple more :oops: :
1. Is it recomended to do this maintance in this directories located in \Ascential\DataStage\Engine too (besides in each project) ?

2. I don't understand "the directory whose pathname is recorded against the UVTEMP configuration parameter". What directory is refered to?

Thanks again, Cecilia
sivatallapaneni
Participant
Posts: 53
Joined: Wed Nov 05, 2003 8:36 am

Post by sivatallapaneni »

Thanx for clearing that up. lesson learnt. I totally forgot about the &PH& and what it contains. i was talking in general i guess about hash file.

live and learn,
Siva.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

cecilia wrote:Thanks a lot for the reply.

Keneth, I have a doubt yet: when I run CLEAR.FILE &PH& the file .uvnlsmap remains in the directory, in that way it's a bit different from delete all files manually. I guess it doesn't matter if .uvnlsmap exist or not, it will be recreated when a job run again, Am I right?
Clearing the &PH& directory is about performance. As it fills with junk from aborted jobs over time, running jobs take longer to wrapup because this directory is full of thousands of files. The hidden file doesn't matter, don't worry about removing it.
cecilia wrote: 1. Is it recomended to do this maintance in this directories located in \Ascential\DataStage\Engine too (besides in each project) ?
No, because no DS jobs execute from the hidden "Engine" project.
cecilia wrote: 2. I don't understand "the directory whose pathname is recorded against the UVTEMP configuration parameter". What directory is refered to?
In the DSEngine directory is a file uvconfig. In there you set the directory for the engine to use to swap temporary work files. Take a peak at it, and then search this forum and you can get some background on it.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

&PH& and &SAVEDLISTS& are normally type 1 files so there should be another hidden file name .Type1. Removing this file will make it a type 19 file. Type 1 and type 19 are UNIX directories or DOS directories. Type 19 is a longname directory which is better. I recommend resizing these files to type 19. I have explained why before. So when you clear these directories then clear all the directories below them as well. Do not remove the directory itself.

cd \&PH\&
rm -rf *
cd ..
cd \&SAVEDLISTS\&
rm -rf *

Is the equivalent of these TCL commands:

CLEAR.FILE &PH&
CLEAR.FILE &SAVEDLISTS&

The &SAVEDLISTS& directory may not exist. If it does not then do not worry. Universe will treat these as files or like a hash file when there is a VOC entry for them which means you can list them.

LIST &SAVEDLISTS&

It is physically a directory and not a hash file but most of the commands that work on hash files will work on these files. Each record is a complete UNIX file or DOS file. This can be very powerful as to looking for files in BASIC. You can process them without creating a VOC entry with a "openpath" statement in BASIC. Ray has posted some code to show a better way to wait for a file. Do a search if you are interested.

Just a little extra info for those trying to learn Universe.
Mamu Kim
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The hidden file .uvnlsmap should not be deleted, and is not deleted by CLEAR.FILE.
This records the NLS character map used for this particular directory.
It is only present if NLS is installed.
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