Final Delimiter in Seq. File Stage of DS Server

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
memrinal
Participant
Posts: 74
Joined: Wed Nov 24, 2004 9:13 pm

Final Delimiter in Seq. File Stage of DS Server

Post by memrinal »

Is there an equivalent of Final Delimiter (Of Parallel Extender' Seq. File), in server's Seq. File Stage.
Actually my input file contains rows from different files, and each record's first field specifies the file to which it belongs. all the columns are delimited by Pipe (|). if there is an equivalent of final delimiter then i can take the second field to different files, depending on the file name in transformer stage.
Please send a copy of reply to my email id also.
Regards,
Mrinal
email ID- Mrinal_Kumar01@infosys.com
davidnemirovsky
Participant
Posts: 85
Joined: Fri Jun 04, 2004 2:30 am
Location: Melbourne, Australia
Contact:

Post by davidnemirovsky »

I haven't come across a 'final delimiter' in DS Server, but from what I understand you are trying to do you don't need it.

If your first field contains 'filename' then you can output the desired results for each file with a Constraint in a transformer stage.

A second set of transformers for each different file (if the format is different for each file) can break out the pipe-delimited fields relavant to each file.
Cheers,
Dave Nemirovsky
memrinal
Participant
Posts: 74
Joined: Wed Nov 24, 2004 9:13 pm

what should be column definition for the first input file

Post by memrinal »

all the different files have different columns, and all are pipe separated. even the input file is pipe separated only.
djhigh wrote:I haven't come across a 'final delimiter' in DS Server, but from what I understand you are trying to do you don't need it.

If your first field contains 'filename' then you can output the desired results for each file with a Constraint in a transformer stage.

A second set of transformers for each different file (if the format is different for each file) can break out the pipe-delimited fields relavant to each file.
sonia jacob
Participant
Posts: 122
Joined: Mon Jul 05, 2004 1:33 pm
Location: MA

Re: what should be column definition for the first input fil

Post by sonia jacob »

Hi,

If I am right, your input file is a follows

File1|data......
File2|data......
....................
....................

FileN|data......

and as your output there would be N files with the appropriate "data".

If you are sure about the number and name of output files, then I guess you could have a transformer with just two columns Col1 which would read File1, File2,... FileN and Col2 which would read the rest of the data till end of line.

If you are not sure about the number and name of output files, then you would require a routine that reads the Input file, based on the the first column create / open the file, write records / go to end of file and write record.

The previous post from David also speaks about the same, I guess.

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

Post by crouse »

To add to Sonia's reply...

If you can detect the row type by the first column in the row via the transformer stage, then send the row to an applicable "Row Splitter" stage that can split the second column up into it's specific columns, without landing the data to a file first.

-Craig
Craig Rouse
Griffin Resouces, Inc
www.griffinresources.com
memrinal
Participant
Posts: 74
Joined: Wed Nov 24, 2004 9:13 pm

Re: what should be column definition for the first input fil

Post by memrinal »

Actually the file is in this format:
File1|Field11|Field12|Field13..............|Field1N
File2|Field21|Field22|Field23|Field24........|Field2M
File1|Field11|Field12|Field13..............|Field1N
File1|Field11|Field12|Field13..............|Field1N
File2|Field21|Field22|Field23|Field24........|Field2M
File2|Field21|Field22|Field23|Field24........|Field2M
File2|Field21|Field22|Field23|Field24........|Field2M
File3|Field31|Field32|..........................|Field3O
File3|Field31|Field32|..........................|Field3O
File3|Field31|Field32|..........................|Field3O
File3|Field31|Field32|..........................|Field3O

Depending on the file name in the first field, i want the otherfields into different files , File1, File2, file3.
davidnemirovsky
Participant
Posts: 85
Joined: Fri Jun 04, 2004 2:30 am
Location: Melbourne, Australia
Contact:

Post by davidnemirovsky »

So as I stated before just output the desired results for each file with a Constraint in a transformer stage. 3 output links (1 for each file) and based on field1 the row goes to the appropriate file.

A second set of transformers for each file splits the pipe-delimited fields for that file.

Is that answering your question or am I missing the point?
Cheers,
Dave Nemirovsky
crouse
Charter Member
Charter Member
Posts: 204
Joined: Sun Oct 05, 2003 12:59 pm
Contact:

Post by crouse »

Looks like you're getting there...

Read the entire row in one column. Use the FIELD function to find the first column and send the remainder of the row as ONE column out the appropriate link of the transform to a ROW SPLITTER stage.

The ROW SPLITTER stage will then automatically split the one column into several columns, based on the delimiter. Read up on the ROW SPLITTER stage. This is exactly the case it was created for: changing column meta data "on the fly" without landing the data to a file first, or without doing a ton of FIELD commands to walk throw the fields.

-Craig
Craig Rouse
Griffin Resouces, Inc
www.griffinresources.com
Post Reply