Append records to a hash file

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Shree0410
Participant
Posts: 70
Joined: Tue Nov 29, 2005 7:25 pm

Append records to a hash file

Post by Shree0410 »

How do I append records to the existing hash file.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If 'append' means 'add new records', just write to it. If you mean something else, be more specific.
-craig

"You can never have too many knives" -- Logan Nine Fingers
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Post 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......
Shree0410
Participant
Posts: 70
Joined: Tue Nov 29, 2005 7:25 pm

Post 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.
vsi
Premium Member
Premium Member
Posts: 507
Joined: Wed Mar 15, 2006 1:44 pm

Post by vsi »

Uncheck both of them
mcolen
Premium Member
Premium Member
Posts: 31
Joined: Wed Aug 11, 2004 8:59 am
Location: Florida

Append to Hash File

Post by mcolen »

Be aware that writing to a file with a duplicate keyed record will over write the existing record
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Shree0410
Participant
Posts: 70
Joined: Tue Nov 29, 2005 7:25 pm

Post by Shree0410 »

I unchecked both the options and I get a "Write caching disabled" warnings and the job aborted.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply