Hi All
I am trying to use CREATE.FILE in a routine as per:
viewtopic.php?t=83463
However I can only create the file in the project directory.
I am wanting to do same in the directory of my choice, in which case the job aborts.
Any ideas?
Adamski
CREATE.FILE and path
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 85
- Joined: Fri Jun 04, 2004 2:30 am
- Location: Melbourne, Australia
- Contact:
Adamski,
the CREATE.FILE syntax does not support the creation of remote files.
A Hash file in it's simplest form is defined by an entry in the VOC file that contains 3 lines - the first starting with "F" to denote a file type entry, the second the OS path to the DATA portion of the file and the third line the OS path to the DICTionary of that file.
The unix level utility to create a DataStage hashed file is mkdbfile, but I am not sure that the command line is documented so I won't go into that here.
I would suggest using CREATE.FILE to create a template empty file. In your routine, instead of creating the file, do an OS-LEVEL copy of the DICT and DATA portions of the file (if you choose a type 30 file then this would be a directory) to the required location. If you want to use the file in Basic code or don't want to specify the path in the DS hash file stage, then you would need to add a file pointer to the VOC. Something along the lines of. Please note that writing to your VOC and getting it wrong might destroy your datastage project account.
the CREATE.FILE syntax does not support the creation of remote files.
A Hash file in it's simplest form is defined by an entry in the VOC file that contains 3 lines - the first starting with "F" to denote a file type entry, the second the OS path to the DATA portion of the file and the third line the OS path to the DICTionary of that file.
The unix level utility to create a DataStage hashed file is mkdbfile, but I am not sure that the command line is documented so I won't go into that here.
I would suggest using CREATE.FILE to create a template empty file. In your routine, instead of creating the file, do an OS-LEVEL copy of the DICT and DATA portions of the file (if you choose a type 30 file then this would be a directory) to the required location. If you want to use the file in Basic code or don't want to specify the path in the DS hash file stage, then you would need to add a file pointer to the VOC. Something along the lines of
Code: Select all
WRITE "F":@FM:"/tmp/myfiles/NewHashFile":@FM:"/tmp/myfiles/D_NewHashFile" ON VocFilePtr, "NewHashFile" ELSE ....
-
- Premium Member
- Posts: 385
- Joined: Wed Jun 16, 2004 12:43 pm
- Location: Virginia, USA
- Contact:
Or, you can use a server job to create and/or clear your hashed files. Try:
where the constraint on the output link is @FALSE, and the transform stage has a stage variable. As you know, the hashed file stage will create hashed files in either the project or another directory. Therefore, you get the best of all worlds, a concise job design that conveys a great deal of information visually, protection from internal DataStage changes, and a design more familiar to those new to DataStage Basic.
Code: Select all
XFR ---> HASH
Chuck Smith
www.anotheritco.com
www.anotheritco.com
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You can also use DDL. This has the side-effect of building the dictionary (as does Chuck's approach).
Code: Select all
CREATE TABLE tablename
DATA pathname
DICT pathname
(
column_definition_1,
column_definition_2,
etc.
);
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.