Page 1 of 1

copy hashed file

Posted: Tue Sep 16, 2008 9:57 pm
by deswhk
Can I copy the hashed file directory and its dictionary file in binary mode from one location to another loaction?

Posted: Tue Sep 16, 2008 10:11 pm
by ray.wurlod
Yes, provided that the hardware is compatible (primarily byte order).

For example, copying from a non-Intel chip to an Intel chip would cause difficulties, because every pair of bytes in the hashed file would be in the wrong order.

This can be remedied with the format.conv utility (also known as fnuxi).

Posted: Tue Sep 16, 2008 11:13 pm
by deswhk
ray.wurlod wrote:Yes, provided that the hardware is compatible (primarily byte order).

For example, copying from a non-Intel chip to an Intel chip would cause difficulties, because every pair of bytes in the hashed ...
Ok, but after I copied the hashed file cannot be read. It gives me junk characters. This is how I did it.
1) FTP-ed in binary mode from machine 1 to machine 2 the hashed file directory (<hashed file name>) and the dictionary file (D_<hashed file name>)
2) created a pointer to the hashed file directory which contains data.30 and over.30
3) when I view the data of the hashed file in designer mode, it gives me 2 records with some junk characters. Part of the junk characters contain "DATA.30" in the first record and "OVER.30" in the second record.

I am not sure if this is due to the copying or the pointer.

Posted: Tue Sep 16, 2008 11:23 pm
by tcj
Did you copy over the .Type30 file?

Posted: Tue Sep 16, 2008 11:55 pm
by ray.wurlod
You don't have to copy .Type30 - it's empty. But it does need to be there. It signals to DataStage that this directory is a hashed file. Without it DataStage treats it as an ordinary directory, and DATA.30 and OVER.30 as ordinary files, with the results you obtained. Hopefully you have not attempted to make any changes to the "hashed file". A hashed file directoy must contain only DATA.30, OVER.30 and .Type30 files, and must contain all of them. DATA.30 and OVER.30 are not text files; don't try to edit them with text editors.

Posted: Wed Sep 17, 2008 12:19 am
by deswhk
ray.wurlod wrote:You don't have to copy .Type30 - it's empty. But it does need to be there. It signals to DataStage that this directory is a hashed file. Without it DataStage treats it as an ordinary directory, and ...
Where is this .type30 file located? I don't find it in the hashed file directory. I am using a dynamic hashed file.

Posted: Wed Sep 17, 2008 12:31 am
by ray.wurlod
It has to exist. Look in a "proper" hashed file directory. Note that it has a leading "." and a capital "T". UNIX is case sensitive. The leading "." means that it is a hidden file so you would need the -a option with ls to be able to see that it is there.

Posted: Wed Sep 17, 2008 1:17 am
by deswhk
ray.wurlod wrote:It has to exist. Look in a "proper" hashed file directory. Note that it has a leading "." and a capital "T". UNIX is case sensitive. The leading "." means that it is a hidden file so you would nee ...
You are right. I can view the hashed file after copying over that .type30 file. Thanks! :)

Posted: Wed Sep 17, 2008 7:10 am
by chulett
Time to mark the topic as Resolved then, using the green button at the top of the screen.