How can I copy hash files from UNIX command line?

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
ankita
Participant
Posts: 57
Joined: Sun Nov 13, 2005 11:17 pm

How can I copy hash files from UNIX command line?

Post by ankita »

Hi All,
Is it possible to copy hash files from unix command line ?
If yes, then can anyone please help me with the exact command ?

Thanks in advance !
Ankita
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Yes, hashed files can be copied - but they might not be useable afterwards. If you reference hashed files using a VOC entry the files cannot be copied unless you know how to change the VOC pointers. If you access the hashed file using an absolute path then you can copy it. A dynamic hashed file is a subdirectory with 3 files, a DATA.30, an OVER.30 and a hidden file .Type30 and all 3 must be copied. If you use secondary indices on the hashed file it also becomes complex to copy and you should avoid doing so.
sweety123
Participant
Posts: 18
Joined: Thu Dec 10, 2009 5:28 am

Post by sweety123 »

Hi,

I want to copy a hashed file from one directory to another for different projects. I am able to copy the hashed file, but when I use the copied file in my job, I get the error:

Hashed_File_0.DSLink3: DSD.UVOpen Unable to open file HF_test.

Can anybody tell me how to overcome this issue?

Thanks in advance.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Assuming you have NOT created a 'local' hashed file, you can do the following.

Note - better test with a sample before moving files around. Because partial files may result in corruption.

Locate a file and directory with the name "D_<hashed file>" and "<hashed file>" in the place you created from DataStage.

Copy these two into your new location. Ensure that both goes on the same level.

Now it is ready to use.
sweety123
Participant
Posts: 18
Joined: Thu Dec 10, 2009 5:28 am

Post by sweety123 »

Hi Sainath,

Thanks for your response. But since I am not a premium user, I am unable to view your complete answer. Is there any way that you can share the complete answer with me again?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Note: the following WILL NOT WORK if the hashed file was created by a UniVerse stage or using a CREATE TABLE statement.

Code: Select all

cp -ipr HashedFileName targetdirectory ; cp -ip D_HashedFileName targetdirectory
If the hashed file has any indexes, things get a bit more complex - it's probably easier to build the index afresh in the new hashed file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sweety123
Participant
Posts: 18
Joined: Thu Dec 10, 2009 5:28 am

Post by sweety123 »

Thanks Ray, I can use the hashed file now.

What if I have to copy the hashed file to a different server. Is there any command like 'scp' (works for other files) for this purpose?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I typically tar or zip up all of the appropriate files, transfer the archive to the new server and then unzip/untar them over there.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

If the other server is not the same type of server like AIX to AIX then you may have to use fnuxi.

The rule of thumb is hashed files are for temporary storage. They should always be recreated during a load. If you are using hashed files for permanent storage meaning you use data from previous ETL runs then you need to rethink your strategy. You may need staging tables created in your target database.
Mamu Kim
Post Reply