Page 1 of 1

How to clean a hash partitioned?

Posted: Wed Apr 18, 2007 5:31 pm
by marcelo_almeida
Hi,

I created a hash partitioned and I made an initial load. I need to clean this hash, but I don't get.

Procedures already accomplished:

CLEAR.FILE HashName (account)

DELETE.FILE HashName (account)

CLEAR.FILE Hash (parts) (the command worked but it didn't clean, I continue viewing the data in Hash (account)

Nothing of that gave right!


Thank you in advance!

Posted: Wed Apr 18, 2007 6:45 pm
by ray.wurlod
What do you mean by a "hash partitioned"?

The commands you give relate to hashed files. These are not partitioned.

What are you trying to achieve?
What, precisely, did you create, and by what means? Be precise and explicit in your description.

Posted: Wed Apr 18, 2007 10:09 pm
by marcelo_almeida
1 - I CREATED 10 EMPTY HASHED_FILE WITH SAME TABLE DEFINITION

2 - I CREATED POINTERS FOR EACH ONE OF HASHED_FILE OF THE PREVIOUS ITEM
EXAMPLE: SETFILE C:\TMP\HASH_01

3 - I CREATED ANOTHER HASHED_FILE WITH THE COMMAND BELOW, THIS COMMAND RELATES THE FIRST 10 THE THIS.

DEFINE.DF HSH_PESS ADDING HSH_NJ_PESS_01_0 1 HSH_NJ_PESS_01_1 2 HSH_NJ_PESS_01_2 3 HSH_NJ_PESS_01_3 4 HSH_NJ_PESS_01_4 5 HSH_NJ_PESS_01_5 6 HSH_NJ_PESS_01_6 7 HSH_NJ_PESS_01_7 8 HSH_NJ_PESS_01_8 9 HSH_NJ_PESS_01_9 10 INTERNAL " IF @ID[LEN(@ID),1] = 0 THEN 1 ELSE IF @ID[LEN(@ID),1] = 1 THEN 2 ELSE IF @ID[LEN(@ID),1] = 2 THEN 3 ELSE IF @ID[LEN(@ID),1] = 3 THEN 4 ELSE IF @ID[LEN(@ID),1] = 4 THEN 5 ELSE IF @ID[LEN(@ID),1] = 5 THEN 6 ELSE IF @ID[LEN(@ID),1] = 6 THEN 7 ELSE IF @ID[LEN(@ID),1] = 7 THEN 8 ELSE IF @ID[LEN(@ID),1] = 8 THEN 9 ELSE IF @ID[LEN(@ID),1] = 9 THEN 10 ELSE 10 "

4 - IN JOB I PLACED AN STAGE HASHED_FILE WITH HASHED_FILE HSH_PESS, BUT THE DATA ARE RECORDED INDEED IN THE OTHER ONES 10

Posted: Wed Apr 18, 2007 10:43 pm
by ray.wurlod
Aha! A Distributed file.

You must first remove all the part files from the Distributed file before you can delete the individual part files (hashed files).

Code: Select all

DEFINE.DF HSH_PESS REMOVING HSH_NJ_PESS_01_0 HSH_NJ_PESS_01_1 HSH_NJ_PESS_01_2 HSH_NJ_PESS_01_3 HSH_NJ_PESS_01_4 HSH_NJ_PESS_01_5 HSH_NJ_PESS_01_6 HSH_NJ_PESS_01_7 HSH_NJ_PESS_01_8 HSH_NJ_PESS_01_9
Removing the final part file will automatically remove the VOC entry for the Distributed file itself (HSH_PESS).

Posted: Thu Apr 19, 2007 3:39 am
by rameshrr3
I was always curious as to where documentation on distributed files is kept? Remember having seen a mention of it in the Hash Stage disk caching guide.
Is a distributed(hash) file also known as type 27?


Thanks
Ramesh

Posted: Thu Apr 19, 2007 4:47 am
by ray.wurlod
That's correct, Distributed files are also known as Type 27 (which is even more mysterious). There's no really useful documentation about Distributed files in the DataStage documentation; however the UniVerse User's Guide provides comprehensive coverage.

Posted: Thu Apr 19, 2007 6:16 am
by chulett
There was a presentation at AscentialWorld 2004 that went into how one particular company (BCBS?) leveraged distributed hashed files. It was very interesting, pros and cons, routines, the whole nine yards from what I recall.

I'll have to see if I can dig it up.

Posted: Thu Apr 19, 2007 7:23 am
by marcelo_almeida
I executed the command:

DEFINE.DF HSH_PESS REMOVING HSH_NJ_PESS_01_0 HSH_NJ_PESS_01_1 HSH_NJ_PESS_01_2 HSH_NJ_PESS_01_3 HSH_NJ_PESS_01_4 HSH_NJ_PESS_01_5 HSH_NJ_PESS_01_6 HSH_NJ_PESS_01_7 HSH_NJ_PESS_01_8 HSH_NJ_PESS_01_9

But it returned the following error:

"Invalid token "HSH_NJ_PESS_01_0" on the command line"

Posted: Thu Apr 19, 2007 2:45 pm
by ray.wurlod
The individual part files are Type 30. The Distributed file itself, although it is only a logical entity, is Type 27.