Hi.
I still having problem with importing fixed width column data into DataStage.
First of all, I would like to know if we are using fixed width when importing metadata, the column name must be the same as the width that we specified?
Secondly, how about the data? All of them must be in the width that have been specified?
Thanks all for reading and giving me guidance on this issue. Cheers~~
Fixed Width Column
Moderators: chulett, rschirm, roy
The column name doesn't matter whether it is same or not. But give a meaningful name so that it is easy when you are doing your mapping. How fixed width works is by the position. You have to give the correct length otherwise it will end up in some other column. Even if you miss one position your mapping will become wrong.
Hope this helps
Thanks
Siva
Hope this helps
Thanks
Siva
Re: Fixed Width Column
Assuming you are talking about the header record in the file, then yes - or at least no longer than. However, fixed width files generally do not have a header record.kate_gkl wrote:First of all, I would like to know if we are using fixed width when importing metadata, the column name must be the same as the width that we specified?
Yes. Each field must start in the same position in each record. Since the program reading the file cannot tell where fields start and stop based on delimiters, it must rely on the metadata to know how many bytes to read for each column and record.Secondly, how about the data? All of them must be in the width that have been specified?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
I have tried to align the data to the length that I specified in the meta data.
However, when I attempted to view the data, it prompted me an error message:
Is there any wrong in my specification when importing metadata? Or i did something wrong in my sequential file stage?
Thanks! Cheers~~~
However, when I attempted to view the data, it prompted me an error message:
UnableError executing View Data command:
##E TOIX 000159 11:35:03(001) <Sequential_File_0,0> Short read encountered on import. This most likely indicates one of the following possibilities:
Is there any wrong in my specification when importing metadata? Or i did something wrong in my sequential file stage?
Thanks! Cheers~~~
More than likely, yes. However, it's hard to say what is wrong without seeing both your metadata and your data. I'm a little concerned that you had to "align the data to the length that I specified in the meta data", usually it's the other way 'round. Is this just something you are playing with, so to speak, trying it out to see how it works?
From the error I'd guess that at least one of your records is short. Meaning, if the last field is defined as say, 20 characters, and you've only get 18 characters worth of data in it, then there must be 2 spaces at the end of the record to make up the difference. Any chance of that?
From the error I'd guess that at least one of your records is short. Meaning, if the last field is defined as say, 20 characters, and you've only get 18 characters worth of data in it, then there must be 2 spaces at the end of the record to make up the difference. Any chance of that?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers