Page 1 of 1
Folder Stage + extra lines
Posted: Mon Aug 09, 2004 5:40 pm
by MikeMette
Hello,
I'm using the Folder Stage to merge several files together. Between each file I'm getting a blank line. I'm working on a Unix server. Any suggestions of what to look for?
Mike
Posted: Mon Aug 09, 2004 9:41 pm
by ray.wurlod
The end of file character (Ctrl-D in UNIX, Ctrl-Z in Windows).
It's probably impossible to check for when using the Folder stage. Alter your design so that empty lines are filtered out (for example, filter through grep -v '' in UNIX)
Posted: Tue Aug 10, 2004 9:38 am
by MikeMette
ray.wurlod wrote:The end of file character (Ctrl-D in UNIX, Ctrl-Z in Windows).
It's probably impossible to check for when using the Folder stage. Alter your design so that empty lines are filtered out (for example, filter through grep -v '' in UNIX)
Hi Ray,
Thanks for the feedback. I'm trying to keep all my file manipulations inside of datastage. But maybe I can clean the resulting file using the After-Job routine. I'll try it out.
Mike
Posted: Tue Aug 10, 2004 10:48 pm
by ray.wurlod
You CAN do this within DataStage!
The Sequential File stage (version 6 and later) supports the idea of streaming the data through a filter command.
They had zip/unzip in mind when they first created it, but there's no restriction. The stdout of the filter command becomes the stream that is read by the Sequential File stage.
Check it out!
Posted: Wed Aug 11, 2004 9:28 am
by MikeMette
ray.wurlod wrote:You CAN do this within DataStage!
The Sequential File stage (version 6 and later) supports the idea of streaming the data through a filter command.
They had zip/unzip in mind when they first created it, but there's no restriction. The stdout of the filter command becomes the stream that is read by the Sequential File stage.
Check it out!
You know I looked at that originally, but didn't spend enough time with it. I ended up creating another job that strips all blank lines plus others out of the file. It's not pretty but it will be easy to support for others on my team. I will go back and play with that feature, it could have a lot more uses.
Thanks for your help Ray!
Mike