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

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Selva_dwh
Participant
Posts: 11
Joined: Fri Nov 27, 2009 9:03 am

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

Post 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
AVISSIVA
Participant
Posts: 5
Joined: Thu Dec 03, 2009 2:37 am

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

Post 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.
Sivakumar
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post 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.
Selva_dwh
Participant
Posts: 11
Joined: Fri Nov 27, 2009 9:03 am

Post 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.
Selva_DWH
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply