reading flat file problem

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

dr46014
Participant
Posts: 59
Joined: Fri Dec 08, 2006 11:09 am
Location: bhubaneswar

reading flat file problem

Post 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.
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post 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.
Wolfgang Hürter
Amsterdam
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post 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.
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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ds_developer
Premium Member
Premium Member
Posts: 224
Joined: Tue Sep 24, 2002 7:32 am
Location: Denver, CO USA

Post 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
dr46014
Participant
Posts: 59
Joined: Fri Dec 08, 2006 11:09 am
Location: bhubaneswar

Post by dr46014 »

how can i solve that problem.can u plz explan me the funda of CR LF
dr46014
Participant
Posts: 59
Joined: Fri Dec 08, 2006 11:09 am
Location: bhubaneswar

Post by dr46014 »

should i give the line termination
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Is that the problem? :? How about if you explain what you found and if John's guess was on the money...
-craig

"You can never have too many knives" -- Logan Nine Fingers
dr46014
Participant
Posts: 59
Joined: Fri Dec 08, 2006 11:09 am
Location: bhubaneswar

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ds_developer
Premium Member
Premium Member
Posts: 224
Joined: Tue Sep 24, 2002 7:32 am
Location: Denver, CO USA

Post 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
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

How does the data looks in hex editor? Are you having any Nulls or Blanks in the Acct_No column?

Sam
dr46014
Participant
Posts: 59
Joined: Fri Dec 08, 2006 11:09 am
Location: bhubaneswar

Post 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
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post 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.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post 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
Post Reply