reading flat file problem
Moderators: chulett, rschirm, roy
reading flat file problem
this is my flat file which i want to read
Branch,Acct_No,Invoiced_No,Reg_No,Invoiced_Desc,Total Rent
ADFIX,AGN01,12010,RFGA001,Car Rental daxion,12010.5012
ADFXL,AGN01,12011,RFGA002,Car suveria anixum,14012.4512
ADFVL,AGN02,12012,RFGA003,Car various pack,24000.2345
ADFIX,AGN02,12013,RFGA004,car mazium rexiom,12902.123
ADFDX,AGN03,12014,RFGA005,Car besspart,34340.23
i have checked first line is column names.i have also selected appropriate datatypes for the table defination.but when reading i have a problem that its showing an error message that account_no required column missing.i have not specified any terminators and reading it as a comma delimated file.
Branch,Acct_No,Invoiced_No,Reg_No,Invoiced_Desc,Total Rent
ADFIX,AGN01,12010,RFGA001,Car Rental daxion,12010.5012
ADFXL,AGN01,12011,RFGA002,Car suveria anixum,14012.4512
ADFVL,AGN02,12012,RFGA003,Car various pack,24000.2345
ADFIX,AGN02,12013,RFGA004,car mazium rexiom,12902.123
ADFDX,AGN03,12014,RFGA005,Car besspart,34340.23
i have checked first line is column names.i have also selected appropriate datatypes for the table defination.but when reading i have a problem that its showing an error message that account_no required column missing.i have not specified any terminators and reading it as a comma delimated file.
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
I have just read your file without any problems. If you are in doubt, have the datatypes as Varchar like Wolfgang has suggested.
When I read the file, I had the datatype as Varchar with a length of 20.
Whale.
When I read the file, I had the datatype as Varchar with a length of 20.
Whale.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Check the format tab again. Make sure that the delimiter is comma. Then check the stage properties, and make sure that the line terminator is properly specified. Re-import the table definition if necessary, and click Load on both the Format and Columns tabs to resynchronize things.
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.
-
- Premium Member
- Posts: 224
- Joined: Tue Sep 24, 2002 7:32 am
- Location: Denver, CO USA
Repeating your problem without answering any of the questions posed so far gets us no closer to solving your problem.
Have you looked at the file more closely? Via a hex editor perhaps? Are there 'blank' lines or other anomalies at the end after your last data record? I would certainly think so as you've posted a file with 5 records and you have an error with record 6.
Help us help you - tell us what else is in the file.
Have you looked at the file more closely? Via a hex editor perhaps? Are there 'blank' lines or other anomalies at the end after your last data record? I would certainly think so as you've posted a file with 5 records and you have an error with record 6.
Help us help you - tell us what else is in the file.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 224
- Joined: Tue Sep 24, 2002 7:32 am
- Location: Denver, CO USA
CR/LF is the abbreviation for Carriage Return/Linefeed, the common Windows line termination. If the file has too many CR/LF's at the bottom of the file it will return this error. The typical Windows text editors (NotePad and WordPad) won't show these characters visually, but you can tell they are there by going to the bottom of the file and using the arrow buttons to scroll up the file. A "blank" line in the file means there are extra CR/LF's. A better editor will actually show you the characters. You can download a 30 day trial of UltraEdit, which is one of the best editors available.
John
John
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
Ok Its fine that you are new to DataStage. But you tell us without knowing what you are doing there how can someone help you, everyone can only speculate what you are doing thats why everyone is asking for more information which will help you in figuring out your problem.Do you have HEX editor? If not download a trial version and look at your data and get back here and post what is happening.
Sam
Sam