Sequential file data(.csv) file with different record format

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
Shadab_Farooque
Participant
Posts: 21
Joined: Tue Apr 24, 2007 12:39 am

Sequential file data(.csv) file with different record format

Post by Shadab_Farooque »

I have to load a .csv file with different record format in to Oracle Table.
Each data block should contain one header record and zero to many detail records.
Eg:
A,1,3,date,time
B,1,date,time,seq No,transaction made
B,2,date,time,seq No,transaction made
B,3,date,time,seq No,transaction made

Here 1st record starting with A is the header record which has 3 detail records(starting with B).
Header record has 7 columns and detail record has 12 columns.

What stage should I use as input to load this .csv file in the oracle table.
Shadab Farooque
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Re: Sequential file data(.csv) file with different record fo

Post by sachin1 »

if you are well aware of how many columns are their for your parent and child records, just like 7 columns for parent records and 12 fields for child.

then you can use sequential file stage to read your .CSV file and putting constraints in transformer stage you can Segregate out your parent and child record.
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Re: Sequential file data(.csv) file with different record fo

Post by sachin1 »

if you are well aware of how many columns are their for your parent and child records, just like 7 columns for parent records and 12 fields for child.

then you can use sequential file stage to read your .CSV file and putting constraints in transformer stage you can Segregate out your parent and child record.
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Re: Sequential file data(.csv) file with different record fo

Post by sachin1 »

if you are well aware of how many columns are their for your parent and child records, just like 7 columns for parent records and 12 fields for child.

then you can use sequential file stage to read your .CSV file and putting constraints in transformer stage you can Segregate out your parent and child record.
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

CFF stage?
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Re: Sequential file data(.csv) file with different record fo

Post by sachin1 »

hello ray i am extremely sorry for my multiple posts, some problem with sessions.
thebird
Participant
Posts: 254
Joined: Thu Jan 06, 2005 12:11 am
Location: India
Contact:

Post by thebird »

How do you want to load it - only header? header and detail both? or only detail?

In any case, you can use the Sequential Stage and choose the Stage uses filter command option to specify a filter command (using grep command) to read either the header or the detail.

If you want both header and detail - then it makes more sense to read the entire data (header and detail both) in to a transformer and then split these into Header stream and Detail stream (depending on how you want) by using constraints - as suggested above.

Aneesh
Post Reply