Creating a directory based hash file from a Basic routine
Moderators: chulett, rschirm, roy
Creating a directory based hash file from a Basic routine
Hi All,
We have a defined directory for writing all the hash files. This is done for backup and restore purpose.
Now, I am writting a basic routine to create a hash file. Is there a way I can get the hash file created in the specified directory and not in the project directory? I would like to have the file created in the directory and then create F-Pointers to the file.
Any help would be appreciated.
-Thanks
Anjan
We have a defined directory for writing all the hash files. This is done for backup and restore purpose.
Now, I am writting a basic routine to create a hash file. Is there a way I can get the hash file created in the specified directory and not in the project directory? I would like to have the file created in the directory and then create F-Pointers to the file.
Any help would be appreciated.
-Thanks
Anjan
The only way to do this would be to use the mkdbfile command located in the datastage\engine\bin directory. You can do this via a program or manually and the command would look something like -
where
Regards,
Code: Select all
...\engine\bin\mkdbfile c:\HASHTEST 30 1 4 20 50 80 256
- 30 = file type
1 = modulo
4 = separation
20 = hash type
50 = max load
80 = split load
256 = large record size
Code: Select all
....\datastage\engine\bin\mkdbfile c:\D_HASHTEST 3 1 1
Regards,
Mike Hester
mhester@petra-ps.com
mhester@petra-ps.com
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Not the only way! The CREATE TABLE statement supports DATA and DICT clauses that can be used to specify location of the data and file dictionary portions.
As a bonus, this also creates the VOC entry.
On the down side (maybe) it means that data types are enforced. But you can make everything VARCHAR to get around that.
Code: Select all
CREATE TABLE hashed_file_name
DATA /dirpath/hashed_file_name
DICT /dirpath/D_hashed_file_name
(
column definitions...
);
On the down side (maybe) it means that data types are enforced. But you can make everything VARCHAR to get around that.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
hi..
adding to this questions..
we have almost all HASH file stored in C:\projecttemp\ppl directory..
now i want to read this HASH file ...in routine...
when i apply 'SELECT SRC_SYS_ID FROM HASH' it gave me error that hash file doesnt exsists....
so how can i do DS Admin Query in Routines on HASH file stored in particular directory...
thanx..
Himanshu
adding to this questions..
we have almost all HASH file stored in C:\projecttemp\ppl directory..
now i want to read this HASH file ...in routine...
when i apply 'SELECT SRC_SYS_ID FROM HASH' it gave me error that hash file doesnt exsists....
so how can i do DS Admin Query in Routines on HASH file stored in particular directory...
thanx..
Himanshu
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Search the forum for the SETFILE command.
You need to create a pointer (which is stored in the VOC file) to tell DataStage SQL queries where the hashed file is.
You need to create a pointer (which is stored in the VOC file) to tell DataStage SQL queries where the hashed file is.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
I still believe mkdbfile is "easiest" way to create the file. Most will not use the create table since it requires defining columns etc... Not generally what most people want to do.
Mike Hester
mhester@petra-ps.com
mhester@petra-ps.com
Thanks for the response.
Next question -
If I create a file using CREATE TABLE command, do I need to explicitely create an F-pointer or it gets created automatically?
Next question -
If I create a file using CREATE TABLE command, do I need to explicitely create an F-pointer or it gets created automatically?
ray.wurlod wrote:Not the only way! The CREATE TABLE statement supports DATA and DICT clauses that can be used to specify location of the data and file dictionary portions.As a bonus, this also creates the VOC entry.Code: Select all
CREATE TABLE hashed_file_name DATA /dirpath/hashed_file_name DICT /dirpath/D_hashed_file_name ( column definitions... );
On the down side (maybe) it means that data types are enforced. But you can make everything VARCHAR to get around that.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
"As a bonus, it also creates the VOC entry." This is the F pointer to which you refer.
Yes, you drop it using DROP TABLE hashedfilename; if it was created with CREATE TABLE.
I prefer not to use mkdbfile because it does not populate a file dictionary, and I DO like to have my metadata recorded.
Yes, you drop it using DROP TABLE hashedfilename; if it was created with CREATE TABLE.
I prefer not to use mkdbfile because it does not populate a file dictionary, and I DO like to have my metadata recorded.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.