Page 1 of 1

Server Funnel

Posted: Tue Sep 02, 2008 10:32 pm
by ds2000
How Parallel Funnel stage functionality can be used in server job. Want to union two sequential files in a server job. Please comment...thanx.

Posted: Tue Sep 02, 2008 10:52 pm
by tcj
Should be able to use the link collector. Have two sequential links coming into the link collector with a single output from the link collector.

The two sequential links must have the same metadata.

This will merge two sequential files into the one sequential file with the same metadata.

Posted: Tue Sep 02, 2008 11:31 pm
by ray.wurlod
This can cause problems if one file has more rows than the other. The Link Collector waits for the never-to-arrive next row, and eventually takes a timeout error.

Better is to use a filter command in your sequential file stage that creates a stream of all lines from the two files. I prefer TYPE as the command; others like COPY.

Code: Select all

TYPE file1 file2

Code: Select all

COPY file1 + file2

Re: Server Funnel

Posted: Wed Sep 03, 2008 1:10 am
by jib
Use OS command to append one file with the other if there is no header in files. type File1 >> File2 or cat File1 >> File2

Posted: Wed Sep 03, 2008 6:51 am
by chulett
Depending on what 'union' means to you, you can also investigate the Merge stage.

Posted: Wed Sep 03, 2008 8:27 am
by TD_Chile
Ray, how could the link collector cause problems? I use it all the time and sometimes with 10 differents archives (with the same metadata off course) and always works fine.
The CAT, COPY and TYPE commands are also good options too.

Posted: Wed Sep 03, 2008 8:51 am
by TD_Chile
By the way, if you are joining only two files you can also append the files using 2 sequential file stages and in the input from the second specified the option "append to existing file"

Posted: Wed Sep 03, 2008 8:52 am
by TD_Chile
By the way, if you are joining only two files you can also append the files using 2 sequential file stages and in the input from the second specified the option "append to existing file"

Posted: Wed Sep 03, 2008 9:00 am
by chulett
:? Not if both links are 'firing' at the same time. Sequential files by their very nature support multiple readers but only one writer at a time, so you'd need to arrange for them to run in a serial fashion.

Posted: Wed Sep 03, 2008 10:13 am
by TD_Chile
sorry, I forgot to specified that the sequential files must be one after the other to do the append