Joining Sequential Files

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
donlank
Charter Member
Charter Member
Posts: 24
Joined: Fri Nov 05, 2004 11:30 am

Joining Sequential Files

Post by donlank »

I have 3 files with the same column definitions coming from 3 different jobs. I want to put all three files into one file in order to perform one lookup on a hashed file instead of three separate identical lookups.

Is there a way to put these files together?

Thanks,
Kevin
crouse
Charter Member
Charter Member
Posts: 204
Joined: Sun Oct 05, 2003 12:59 pm
Contact:

Post by crouse »

You could "cat" the files together at the command line in a Before Job routine, then read the resultant file and create the hash file.

-Craig
Craig Rouse
Griffin Resouces, Inc
www.griffinresources.com
crouse
Charter Member
Charter Member
Posts: 204
Joined: Sun Oct 05, 2003 12:59 pm
Contact:

Post by crouse »

Or, read all three files with three SeqFile stages and into a Link Collector stage, and then into the hash file.

I like the "cat" option better, though.

-Craig
Craig Rouse
Griffin Resouces, Inc
www.griffinresources.com
donlank
Charter Member
Charter Member
Posts: 24
Joined: Fri Nov 05, 2004 11:30 am

Post by donlank »

I tried the link collector already. It says, "Link Collector Stage does not support in-process active-to-active inputs or outputs"

So the only option to put three files into one in a Server Job is to write a Before Job Routine? There isnt a stage to accomplish this?

Thanks,
Kevin
crouse
Charter Member
Charter Member
Posts: 204
Joined: Sun Oct 05, 2003 12:59 pm
Contact:

Post by crouse »

Nope, no stage to do it (the Before Routine).

You can make the Link Collector work with adding in IPC stages and such. That's why I favor the "cat" method.

-Craig
Craig Rouse
Griffin Resouces, Inc
www.griffinresources.com
changming
Participant
Posts: 68
Joined: Wed Oct 13, 2004 3:35 am

i met save problem before. you can do as such

Post by changming »

donlank wrote:I tried the link collector already. It says, "Link Collector Stage does not support in-process active-to-active inputs or outputs"

So the only option to put three files into one in a Server Job is to write a Before Job Routine? There isnt a stage to accomplish this?

Thanks,
Kevin
open job peoperty and click performence, then select inter process.
anoter suggestion to your job is using multiple instanc, I believe that your job is a typical multi-instance job.
tonystark622
Premium Member
Premium Member
Posts: 483
Joined: Thu Jun 12, 2003 4:47 pm
Location: St. Louis, Missouri USA

Post by tonystark622 »

Why not three sequential file stages into a single hash file stage, only all of them feeding the same hash file?

Tony
crouse
Charter Member
Charter Member
Posts: 204
Joined: Sun Oct 05, 2003 12:59 pm
Contact:

Post by crouse »

The nice thing about DataStage is that there are several ways to do the same thing.

The bad thing about DataStage is that there are several ways to do the same thing.

:D
Craig Rouse
Griffin Resouces, Inc
www.griffinresources.com
jreddy
Premium Member
Premium Member
Posts: 202
Joined: Tue Feb 03, 2004 5:09 pm

Post by jreddy »

If you need just the hash file, and not the 3 individual sequential files, could you modify your 3 initial jobs to write to a hash file, rather than a sequential file ??

this way, all 3 jobs are writing to same hash file and when you are done with those, the next set of jobs can lookup on just this single hash file.
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

Hi jreddy

when doing that make sure that the first file writes to the hash will delete the content before writing the records. Otherwise you will have the old records stacked into it.

Thanks
Regards
Siva

Listening to the Learned

"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar
jreddy
Premium Member
Premium Member
Posts: 202
Joined: Tue Feb 03, 2004 5:09 pm

Post by jreddy »

kevin,

Actually, you might want to clear previous contents only on the first job that creates this hash file. The other two jobs that write to this hash file should insert data in append mode.
donlank
Charter Member
Charter Member
Posts: 24
Joined: Fri Nov 05, 2004 11:30 am

Post by donlank »

Thanks for all your input.

I decided to do an after job routine after the 3rd job finishes and cat all three files together, then do the hash file lookup.
Post Reply