Page 1 of 1

DateToString format "dd-Mon-yyyy"

Posted: Thu Jul 24, 2008 9:26 am
by bp_dsx
Hi
I want to conver incoming dates in following format dd-Mon-yyyy using data stage function in transformer.

I have used following:
:DateToString(TimestampToDate(in_txfrmValidateRec_proclnk.STG_000_SITE_VISIT_DT),('%dd-%Mmm-%yyyy'))
but job is getting aborted saying the wrong format.
Please suggested me the way.
Is any data stage function for the same?

Use oracle fn will not solve my problem. :cry:

Balaram prajapati
+91-9820583531(India,Mumbai)

Posted: Thu Jul 24, 2008 9:39 am
by ArndW
It might be easiest to take this step-by-step with an example. What is a value and datatype of the input value?

Posted: Thu Jul 24, 2008 9:41 am
by mahadev.v
Firstly i doubt that month format mmm will work. Second the timestamp format is wrong. Third the syntax is wrong. If you are using the derivation in transformer, it will change the color to red indicating wrong derivation. And i doubt it would compile. The timestamp format will be something like '%dd-%mm-%yyyy %hh:%mm:%ss' depending on the input format. So pasting a sample record here will help. Also copy paste the exact derivation here, instead of typing.

Posted: Thu Jul 24, 2008 11:18 am
by mandyli
Hi

please check the final ORA stage datatype for Date column.
You need to convert date with time also then only Oracle will accept.

Like mm-dd-yyyy hh:mm:ss and also you need to declare Timestamp in datastage not Date.


Thanks
Man

Posted: Thu Jul 24, 2008 3:26 pm
by ray.wurlod
Don't use a capital "M" in the format string. Use "%dd-%mmm-%yyyy" as the format string. Note, however, that this format string is not applicable if the day number is a single digit; you may need to check for this possibility.