Topic
  • 1 reply
  • Latest Post - ‏2006-03-11T09:39:15Z by SystemAdmin
SystemAdmin
SystemAdmin
332 Posts

Pinned topic trying to create hash file using Basic

‏2006-03-08T21:20:11Z |
hi,

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")
STOP
END
*
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'
END ELSE
Call DSLogInfo("Cannot Open DbMbrHash","ERROR")
STOP
END[/code:1:cdfc622ba5]

thanks
Sumeet
Updated on 2006-03-11T09:39:15Z at 2006-03-11T09:39:15Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    332 Posts

    Re: trying to create hash file using Basic

    ‏2006-03-11T09:39:15Z  
    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.