Page 1 of 1

How to read the attached file using sequential file stage

Posted: Tue Mar 24, 2009 12:35 am
by cbhutani2
Hi,
A source file is given to me as csv file but when I open it, it looks like a normal excel file.
How do I read it using sequential file stage. The file is having extn .csv, but opens normally as a excel file having columns, Bank_id, bank_desc, Bank_Branch_id, Bank_branch_desc,Bank_branch_address etc.

You can assume that when one views that file, it opens normally as, the column headings in the first line and from 2nd row onwards the data. There are no delimiters, similar to the data as in an excel file.

Under the properties tab, I have selected 'first row is column names' and selected the csv file.

For format tab, cud u pls let me know what I have to select for:
Record level -> final delimiter?
Field defaults -> delimiter?
Field defaults -> quote?

Or anything else which needs to be done to read such a file?

import that from sequential file definitions

Posted: Tue Mar 24, 2009 12:54 am
by sureshreddy2009
:lol:
Hi
First import from sequential file definitions,at the time of importing select first line is column names and import into datastage,
then in the sequential file , as u already done select firstline is column names and import the table definitions at columns tab,
now the point here is you dont want to set format tab manually, go to sequential file format tab and there import option is there at bottom of that format page, import that file table definitions into format tab, then it will automatically sets the format,
i think the file is fixed length file

Posted: Tue Mar 24, 2009 12:54 am
by ray.wurlod
Your first job is to find out what kind of file it is. That a CSV file opens in Excel is perfectly normal because CSV is associated with Excel in your Windows environment. You need to bypass that association, for example using "Open With..." from the right-click menu. If all is good you can import the table definition from the CSV file and read it normally using a Sequential File stage.

There is no final delimiter - remove this property. The field delimiter is comma and the quote character is whatever is in the file - either double or none would be my guess.

Posted: Tue Mar 24, 2009 1:17 am
by p.amutha
Hi,

We should set the below property to read the *.csv file in sequential stage

Record level -> final delimiter->none
Field defaults -> delimiter->comma
Field defaults -> quote->none

Re: import that from sequential file definitions

Posted: Tue Mar 24, 2009 11:56 pm
by cbhutani2
Hi Suresh,
When I did all the steps, you have said, and did view data,
it gives error on view data as:
<main program> Accept timed out retries=4.

Could you pls help.

Regards,
Sumati.
sureshreddy2009 wrote::lol:
Hi
First import from sequential file definitions,at the time of importing select first line is column names and import into datastage,
then in the sequential file , as u already done select firstline is column names and import the table definitions at columns tab,
now the point here is you dont want to set format tab manually, go to sequential file format tab and there import option is there at bottom of that format page, import that file table definitions into format tab, then it will automatically sets the format,
i think the file is fixed length file

Re: How to read the attached file using sequential file stag

Posted: Wed Mar 25, 2009 12:59 am
by Pagadrai
Hi Sumati,
First step is to understand the file format. Reading from the file
will be pretty easy.
Can you open the file in textpad and see if it has any delimiters?
(comma, space, tab etc)
and are the values enclosed in quotes?
is the file a fixed width?
Also, once you define the fomat and columns tab, you have 'View data'
option there. can you tell what is the error you get there?