Lookup
Moderators: chulett, rschirm, roy
Lookup
Hi-
I am having a problem when I try to have a lookup with a field to get a key.
The source field I have is 'A' with a CHAR datatype and the lookup table
lookup field 'B' with a TIMESTAMP datatype When I try to join these two fields to get a new field it's giving lot of errors.
I tried to change the source table field name to 'B' and datatype to timestamp in the Transformer but still it's not working
All the records are coming upto lookup and after that the data is not moving Looks like something is going on in Lookup Stage.
Giving fallowing errors.
Lookup,1: Field "B" has keyprep export format error; value: *******************
Failed keylookup on table (/u01/Ascential/DataStage/tldscratch/dynLUT129846247cfbd77)
Is there any suggestion
Thanks
I am having a problem when I try to have a lookup with a field to get a key.
The source field I have is 'A' with a CHAR datatype and the lookup table
lookup field 'B' with a TIMESTAMP datatype When I try to join these two fields to get a new field it's giving lot of errors.
I tried to change the source table field name to 'B' and datatype to timestamp in the Transformer but still it's not working
All the records are coming upto lookup and after that the data is not moving Looks like something is going on in Lookup Stage.
Giving fallowing errors.
Lookup,1: Field "B" has keyprep export format error; value: *******************
Failed keylookup on table (/u01/Ascential/DataStage/tldscratch/dynLUT129846247cfbd77)
Is there any suggestion
Thanks
The datatype can be directly changed in Transformer stage. You will need an explicit conversion function. You need to make sure the key field of main stream as well as the lookup stream are of same datatype and same length. Atlest compatible datatype.
The warning that been shown is due to the reason, Null value is assigned in Date field due to improper conversion of datatype.
The warning that been shown is due to the reason, Null value is assigned in Date field due to improper conversion of datatype.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
In Enterprise Edition, you need to be bit careful with the conversions and format unlike server edition where direct conversions are possible. Try doing an explicit conversion like StringtoTimestamp on field 'A' in the transformer and do not forget to handle the Null values existing in that field.
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
Thomas Alva Edison(1847-1931)
Could you explain you job design? What is DSLink83 connecting to?
Was your conversion successful?
What is the source value and what is the conversion logic you used?
If you write the data to a sequential file before lookup, were you able to the value of timestamp getting converted correctly?
Was your conversion successful?
What is the source value and what is the conversion logic you used?
If you write the data to a sequential file before lookup, were you able to the value of timestamp getting converted correctly?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
DSLINK88 is connected to lookup stage.
Ok I tried to write the output data to a file.
by applying string to timestamp conversion function in the transformer for a field with char datatype to timestamp datatype but when I see the data of the field that I want to see as timestamp it was ****** in the output file
the input data of that field is 20061205.
The whole thing is happening before it goes to lookup stage.
The conversion logic that I used in the transformer for the 'B' is
StringToTimestamp(DSLink77.B)
Thanks
Ok I tried to write the output data to a file.
by applying string to timestamp conversion function in the transformer for a field with char datatype to timestamp datatype but when I see the data of the field that I want to see as timestamp it was ****** in the output file
the input data of that field is 20061205.
The whole thing is happening before it goes to lookup stage.
The conversion logic that I used in the transformer for the 'B' is
StringToTimestamp(DSLink77.B)
Thanks
APT_CombinedOperatorController,0: Caught exception from runLocally(): APT_ParseError: Parsing parameters "%yyyy%mm%dd%" for conversion "timestamp=timestamp_from_ustring[%yyyy-%mm-%dd %hh:%nn:%ss](ustring)": APT_Conversion_String_TimeStamp: Invalid Format [%yyyy%mm%dd%] used for string_from_time type conversion.
The above errors are getting when we I use the function that was told by you.
Thanks
The above errors are getting when we I use the function that was told by you.
Thanks
Due to some reason, you were not able to give the full details, or perhaps you were not able to find related to what the is data type and value of data from Lookup as well as from main stream.
Let me do that work for you. Let me repharse the structre of your job as,
Input is sequential file, with the key as a char field with the value in the pattern of '20061205'. You are using a Transformer stage to convert this key to Timestamp field before reaching the Lookup stage.
And lookup is also sequential file, and the data avaialble is in '1970-01-01 00:00:00'. And it is read as Timestamp datatype.
You are doning lookup via a lookup stage using the key.
Pls correct if there is any wrong in the above assumption.
If ther is no, you can go with a way that the two data can be convert to a common datatype.
Since the lookup data's time portion is not populated, you can trunc that to Date as well.
Let me do that work for you. Let me repharse the structre of your job as,
Input is sequential file, with the key as a char field with the value in the pattern of '20061205'. You are using a Transformer stage to convert this key to Timestamp field before reaching the Lookup stage.
And lookup is also sequential file, and the data avaialble is in '1970-01-01 00:00:00'. And it is read as Timestamp datatype.
You are doning lookup via a lookup stage using the key.
Pls correct if there is any wrong in the above assumption.
If ther is no, you can go with a way that the two data can be convert to a common datatype.
Since the lookup data's time portion is not populated, you can trunc that to Date as well.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'