Page 1 of 1

How to read Seq file in parallel job to wirte different tabl

Posted: Tue Dec 22, 2009 7:40 am
by Selva_dwh
Hi,
I am trying to read the seq file ( txt ). from the parellel job.
I have to write to oracle table.

Txt file - 1 line is header which i have to write in table 1
and from 2nd lines are the data which I have to write in the table 2
and 3th line is tail which suppose to go to table 3.

eg. of the seq text file.
CUST|20091222
1362605|16957|34|4|0|16177|Ninth |37229|Nashville
COUT|10|20091222

I am using Sequential_File to read the file. from there I am trying to write it to 3 other tables.

Do not know how to read header part ( 1st line )and middle part ( other lines ) and tail part to write it in the tables

I am using win xp , orcale 9i

Pls assits.

Thanks

Re: How to read Seq file in parallel job to wirte different

Posted: Tue Dec 22, 2009 8:24 am
by AVISSIVA
Selva_dwh wrote:Hi,
I am trying to read the seq file ( txt ). from the parellel job.
I have to write to oracle table.

Txt file - 1 line is header which i have to write in table 1
and from 2nd lines are the data which I have to write in the table 2
and 3th line is tail which suppose to go to table 3.

eg. of the seq text file.
CUST|20091222
1362605|16957|34|4|0|16177|Ninth |37229|Nashville
COUT|10|20091222

I am using Sequential_File to read the file. from there I am trying to write it to 3 other tables.

Do not know how to read header part ( 1st line )and middle part ( other lines ) and tail part to write it in the tables

I am using win xp , orcale 9i

Pls assits.

Thanks
Include Transform Stage, In Transform stage you can spilit output records based on the condition.

Posted: Tue Dec 22, 2009 8:34 am
by chulett
Read the record as a single long string. Break out the first field (various ways to do that) and direct your output based on the content of that first field: 'CUST', 'COUT' or none of the above. Colum Inport and/or Filter stages should be useful here.

Posted: Tue Dec 22, 2009 8:54 am
by Sainath.Srinivasan
Grep the header and trailer rows using the identifiers as part of file name filter. They can be loaded externally to DataStage using plain sql in before or after script.

Posted: Wed Dec 23, 2009 1:09 am
by Selva_dwh
Still not able to fig out , and how to do stuck - not able to read the first line ( header and write in the table , and other detail rows to other table, and last line tail part to another take

Which stage should I use and give me some hints pls.

Posted: Wed Dec 23, 2009 1:12 am
by ray.wurlod
Use a Sequential File stage with metadata for the detail rows. Set up a reject link, which will capture the header and trailer rows. Downstream on the reject link use Column Import stages to re-parse these rows.