DateToString format "dd-Mon-yyyy"

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
bp_dsx
Participant
Posts: 4
Joined: Tue Apr 22, 2008 8:32 am
Location: Mumbai

DateToString format "dd-Mon-yyyy"

Post 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)
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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?
mahadev.v
Participant
Posts: 111
Joined: Tue May 06, 2008 5:29 am
Location: Bangalore

Post 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.
"given enough eyeballs, all bugs are shallow" - Eric S. Raymond
mandyli
Premium Member
Premium Member
Posts: 898
Joined: Wed May 26, 2004 10:45 pm
Location: Chicago

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply