Page 1 of 2

reading flat file problem

Posted: Thu Dec 28, 2006 1:11 am
by dr46014
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.

Posted: Thu Dec 28, 2006 1:38 am
by WoMaWil
when reading a flat file with the Server Edition, best practice is reading first each field as Varchar-DataType and checking and transforming any field in the first transformer Stage.

Posted: Thu Dec 28, 2006 2:02 am
by I_Server_Whale
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.

Posted: Thu Dec 28, 2006 6:17 am
by ray.wurlod
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.

Posted: Thu Dec 28, 2006 8:42 am
by ds_developer
I would look at the file in a real text editor to see where the carriage return/linefeeds are. I suspect you have a couple of extra CR/LF's at the end of the file.

John

Posted: Thu Dec 28, 2006 9:06 am
by dr46014
how can i solve that problem.can u plz explan me the funda of CR LF

Posted: Thu Dec 28, 2006 9:09 am
by dr46014
should i give the line termination

Posted: Thu Dec 28, 2006 9:12 am
by chulett
Is that the problem? :? How about if you explain what you found and if John's guess was on the money...

Posted: Thu Dec 28, 2006 9:24 am
by dr46014
i am still facing the problem
the error message it is showing while reading the file is
Invoice_tbl_load..Sequential_File_2.DSLink3:read_delimated()-row 6,column Acct_No,required column missing.

Posted: Thu Dec 28, 2006 9:29 am
by chulett
:roll: 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.

Posted: Thu Dec 28, 2006 10:27 am
by ds_developer
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

Posted: Thu Dec 28, 2006 10:36 am
by us1aslam1us
How does the data looks in hex editor? Are you having any Nulls or Blanks in the Acct_No column?

Sam

Posted: Thu Dec 28, 2006 10:42 am
by dr46014
ok..thanks for your reply.
if i find any extra lines how i will eliminate them.
actually i am very new to datastage.thats why i am not sure about all its features

Posted: Thu Dec 28, 2006 10:47 am
by narasimha
You need to figure out what you find then you can plan on removing it.
Otherwise you may end up eliminating things which you didn't have to.

Posted: Thu Dec 28, 2006 10:52 am
by us1aslam1us
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