date_from_ustring

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
cherry
Participant
Posts: 108
Joined: Sun Jul 10, 2005 1:35 am

date_from_ustring

Post by cherry »

Hi All,

Could some one help me how to get rid of this warning message.

My input is a reading from a sequential file and loading to a DB2 table.

Input has a field with type of Varchar(8) and Target field type of Date(10).

When I do a StringToData(<FieldName>,"%YYYY-%MM-%DD") iam getting the following warning message.

Transformer_2,0: Conversion error calling conversion routine date_from_ustring data may have been lost.

Thanks in advance

Best regards
Cherry
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Is there a UStringToDate() function? If so, use it. Otherwise use a message handler to demote the warning to informational.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
abhijain
Participant
Posts: 88
Joined: Wed Jun 13, 2007 1:10 pm
Location: India

Post by abhijain »

There is no UstringToDate function actually, you can first convert Ustring to string and then can use String to date function. like..

UStringToString(StringToDate(%datestring%,"%yyyy-%mm-%dd"))
Rgrds,
Abhi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

StringToDate(<FieldName>,"%YYYY-%MM-%DD") says what your source data looks like, not the target. And that's 10 characters, hence the error using that with your 8 character source.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vvsmk
Participant
Posts: 2
Joined: Mon Jun 28, 2010 4:31 pm

Post by vvsmk »

If IsValid('Date', DSLink58.open_dt)=1Then StringToDate(UStringToString(DSLink58.open_dt[1,10]),"%yyyy-%mm-%dd") Else "0000-00-00"

this one worked for me
Post Reply