Page 1 of 1

Append records to a hash file

Posted: Mon Aug 14, 2006 11:07 am
by Shree0410
How do I append records to the existing hash file.

Posted: Mon Aug 14, 2006 11:11 am
by chulett
If 'append' means 'add new records', just write to it. If you mean something else, be more specific.

Posted: Mon Aug 14, 2006 11:13 am
by meena
Hi Shree..
I think we do not have append option in hash file..Check whether you can do this way or not..Load the data initially into a sequential file and next to hash file where we have option of sending the appended data......

Posted: Mon Aug 14, 2006 11:21 am
by Shree0410
Ok, specific.
I have Job1 to create and write records to HashFile1. My properties here are checked the "Create File" and checked the ""Delete file before create" in the Options.

In my Job2, I want to add new records to the same file HashFile2.

On the General tab, which properties should I use to make sure the records gets added.

Posted: Mon Aug 14, 2006 11:29 am
by vsi
Uncheck both of them

Append to Hash File

Posted: Mon Aug 14, 2006 11:47 am
by mcolen
Be aware that writing to a file with a duplicate keyed record will over write the existing record

Posted: Mon Aug 14, 2006 12:09 pm
by chulett
vsi wrote:Uncheck both of them
Actually, the only one you need to uncheck is the 'Delete file before create' one. The create one is safe to leave alone as it just gives you the option of overriding defaults when the file is created. And it is only created if it doesn't already exist. Which actually happens whether that option is checked or not.

That being said, uncheck both so your intentions to 'append' data to an existing hashed file are more clearer. :wink:

Posted: Mon Aug 14, 2006 1:45 pm
by Shree0410
I unchecked both the options and I get a "Write caching disabled" warnings and the job aborted.

Posted: Mon Aug 14, 2006 2:01 pm
by chulett
Write caching disabled is a normal informational message and isn't a problem. Something else caused your issue. You need to post the actual message from the log - don't paraphrase or type it here by hand, cut and paste it please. Just saying "it aborted" doesn't tell us anything.

Posted: Mon Aug 14, 2006 11:50 pm
by DSguru2B
Actually its safe to leave both 'create file' and 'delete file before create' options checked in job1 if thats the job that always runs first and creates a fresh hashed file. Its just job2 where you need to uncheck both these options and use the name of the same hashed file as job1.