Populating the target table

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

Post Reply
rajeevm
Participant
Posts: 135
Joined: Sun Jan 22, 2006 10:44 am

Populating the target table

Post by rajeevm »

[b]Hi All,


I am trying to populate the table which is our staging table as we extract the data from the sequential file. when i run this job I am getting lot of warnings saying '
DATA HAS BEEN TRUNCATED' what could be the reason its getting like this. I am unable to understand this i have checked the columns if there is any mismatch and also length and data types but everything is fine.

Please try to give you valuable suggestions in order to resolve it.

Thanks[/b]
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Well aparantly, you missed a column or two. Since your source is a flat file, its hard to say what the maximum length can be. You will have to put in a LEN() function to get the length of each and every column. Inspect to get the max of all the lengths that you got and then compare that with your target table. I know, its a pain. :?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
rajeevm
Participant
Posts: 135
Joined: Sun Jan 22, 2006 10:44 am

Post by rajeevm »

hi DSguru,

Thanks for quick response its kinda tricky i didn't get your point how do i use the len function. as I didn't miss any columns in the source everything was fine. I have to clarify that i am running the historical data to the stage table when i ran for two years it was fine but when i try to run for the third year i am getting these warnings.

Thanks
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Well, then you need to look at 3rd year's data and see which column's data is going beyond its definition.
Do a spot check on the data, if you see any data going beyond its definition thats the culprit. If the number of columns are large, then source your file, put in a Len() function to get the length of the field in the transformer , pass it through the aggregator, get max of all the columns. Group on a dummy key that you will create in the transformer. Load it to another flat file. Now open the file and check the size of each field. It should be less or equal to the target columns. The column that does'nt satisfy this rule is the culprit. Fix the data or increase that particular column(s)' size in the target table.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Check the lengths of both your source and target fields and see if there is any huge difference for particular fields. Especially, fields with descriptions, addresses and so on. What the warning implies is that data from a particular source field(s) cannot fit into its corresponding target field as the length of the target field is less than that of source.
Kris

Where's the "Any" key?-Homer Simpson
rajeevm
Participant
Posts: 135
Joined: Sun Jan 22, 2006 10:44 am

Post by rajeevm »

I have checked the source and target lengths as well as the data types are same is there any other way to do this

Thanks for you help
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Post by DeepakCorning »

The simplest way to do this will be to replace ur Target "table" with yet another flat file (smae strucutre as ur target table as of now) and check the data which gets populated in the file.

Its a hectic process but u will need to go on doing this and may be narrowing down the data processed (yearly may be monthly) will help you in debugging this.
rajeevm
Participant
Posts: 135
Joined: Sun Jan 22, 2006 10:44 am

Post by rajeevm »

Hi Deepak,

I tried with another flat file but it just populated fine , but when i try to populate the table why i am getting the warnings, I do not have the data which can be processed by monthly i just have to dump the rows which represent the year 2004-2005 from the source i.e sequential file. our target table is nothing but the stage table i need to further extract from there to move onto the target.

Any input would be appreciated.

Thanks
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Buddy, try with Len() function to get the exact lengths. Only then you can check with the target metadata. Otherwise it will be very tedious. You might get lucky and spot the culprit column(s) or it might take you forever. Thats why try with the Len() function.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Post by DeepakCorning »

If you can not point it the way i told u , try what DS Guru is saying. Its a veru effective method. You will get exact length , but again it will not be easy.

You can also try somethign liek Maximum Len so that u know whats the max len of a column in the file.
rafik2k
Participant
Posts: 182
Joined: Wed Nov 23, 2005 1:36 am
Location: Sydney

Post by rafik2k »

Is any row getting rejected due to truncation?
What database are you using?
There might be data issue like junk character.

Check some sample source data
baglasumit21
Participant
Posts: 132
Joined: Wed Mar 01, 2006 11:12 pm
Location: Pune

Re: Populating the target table

Post by baglasumit21 »

rajeevm wrote:Hi All,


I am trying to populate the table which is our staging table as we extract the data from the sequential file. when i run this job I am getting lot of warnings saying '
DATA HAS BEEN TRUNCATED' what could be the reason its getting like this. I am unable to understand this i have checked the columns if there is any mismatch and also length and data types but everything is fine.

Please try to give you valuable suggestions in order to resolve it.

Thanks
Check the length of the file columns. Also it may be due to the file format you are selecting. Check whether you have used 'Fixed Width File' or 'Delimited file'
SMB
Post Reply