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?
How to read the attached file using sequential file stage
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 62
- Joined: Sat Mar 07, 2009 4:59 am
- Location: Chicago
- Contact:
import that from sequential file definitions
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
Suresh Reddy
ETL Developer
Research Operations
"its important to know in which direction we are moving rather than where we are"
ETL Developer
Research Operations
"its important to know in which direction we are moving rather than where we are"
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Re: import that from sequential file definitions
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.
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:
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
Sumati
Re: How to read the attached file using sequential file stag
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?
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?