i have this hash file job designed using Datastage Basic routine.
this job populates a hash file 'DbMbrHash' from the sequential file 'dbmbr.txt'.
now the routine is such that the Hash file has to be present so that its just opened and written into. No i want to get rid of the necessity of hash file being persistently present. So I am adding the
EXECUTE 'CREATE.FILE DbMbrHash'
but this doesnt seem to work. why is that?? and suggestions are invited
code:1:cdfc622ba5OPENSEQ PROJECT_HOME:'/seq/dbmbr.txt' TO F.SEQ ELSE
Call DSLogInfo("Unable to open ":PROJECT_HOME:'/seq/dbmbr.txt',"Output")
TCL = 'LogTo ':FIELD(PROJECT_HOME,'/',5)
Call DSExecute("TCL", TCL, ScreenOutput, SystemReturnCode)
Call DSLogInfo("Logged to Project ":FIELD(PROJECT_HOME,'/',5), "LOGTO")
****EXECUTE 'CREATE.FILE DbMbrHash*****
OPEN 'DbMbrHash' TO F.HASH THEN
EXECUTE 'CLEAR.FILE DbMbrHash'
Call DSLogInfo("Cannot Open DbMbrHash","ERROR")
Pinned topic trying to create hash file using Basic
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2006-03-11T09:39:15Z at 2006-03-11T09:39:15Z by SystemAdmin
SystemAdmin 110000D4XK332 Posts
Re: trying to create hash file using Basic2006-03-11T09:39:15ZThis is the accepted answer. This is the accepted answer.Take a look at the SDK routines for key management. These create the hashed file SDKSequences if it can't be opened.
It's not good code - they then go and try to read the sequence record without checking whether the file is opened or not. But it's a starting point.
Don't forget to add the file type to your CREATE.FILE command. The best file type to use is DYNAMIC or 30 (these are synonyms).
Note, too, that just CREATE.FILE does not build a file dictionary, so you could not import a table definition from the hashed file. You may prefer to execute a CREATE TABLE statement instead.