I've reviewed viewtopic.php?t=92114&highlight=CREATE+TABLE but still have this question...
I have a job like:
Code: Select all
DRS --> xfm --> DRS --> hashed_file (2)
^
|
hashed_file (1)
(sorry for the badly formatted ascii art, hashed_file (1) is a lookup for the xfm transformation)
hashed_file (1) is pre-loaded into memory
hashed_file (2) has create file / clear file ticked
This is all to support surrogate key generation, with code like:
If IsNull(Lookup_SKs.FooSK) Then KeyMgtGetNextValueConcurrent("source.foo") Else Lookup_SKs.FooSK
although I intend to change this to:
If (Lookup_SKs.NOTFOUND) Then ...
My issue is, after physical file cleanup, or migration to a new environment, hashed_file (1) does not exist, and the job aborts.
What is the best practice and syntax to implement the following pseudocode:
If (Directory Path): #$HashFileLocation# (File name): #DSStageName# does not exist, create an empty hashed file in #$HashFileLocation#/#DSStageName#.
This would then allow the job to run, generating new SK's for each input row, then update the hash.
The code should not generate an error if the hashed file already exists, should (hopefully) support the DS automatic variables noted above (I doubt this will be the case - would require a before routine to "peek into" the structure of the job), and should optionally allow me to write a warning to the log if the file does not exist.
I tried this command from the operating system, with the noted results:
/tmp > /opt2/ds/Ascential/DataStage/DSEngine/bin/create.file DATA TEST DYNAMIC
Unable to open VOC file.
*** Processing cannot continue. ***
Various permutations of this command resulted in the same error.
Thanks,
Scott