conversation of current_timestamp

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
times29
Premium Member
Premium Member
Posts: 202
Joined: Mon Sep 22, 2008 3:47 pm

conversation of current_timestamp

Post by times29 »

Hi,
I am using current_timestamp in transformer which gives ouput 2012-05-05 08:05:37
user want it to be 05/05/2012 08:05:37 . Any idea who should i do it in transformer.

Thanks
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Post by jerome_rajan »

Use TimestampToString(CurrentTimestamp(), "%mm/%dd/%yyyy %hh:%nn:%ss")
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
times29
Premium Member
Premium Member
Posts: 202
Joined: Mon Sep 22, 2008 3:47 pm

Post by times29 »

i get warnings while doing it
Data string '04/24/2012 04:20:36' does not match format '%yyyy-%mm-%dd %hh:%nn:%ss': the value for tag %yyyy has fewer characters than expected.
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

You have got your output column as a varchar?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Are you sure you used TimestampToString() function?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sreewin7
Participant
Posts: 41
Joined: Tue Sep 14, 2010 8:48 pm

Try with peek stage

Post by sreewin7 »

Try to load data in to peek, if you are using parellel jobs.
If that is working as per your requirmment.
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Post by jerome_rajan »

Just a hunch. I think his target is a Timestamp field rather than a 'String' that holds a timestamp value. This could be the reason why DataStage is trying to compare the output of the TimestampToString with the default DataStage format and consequently warning the user about the mismatch
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Another example of why it is so important to post the complete error message - we would have been able to see which stage generated it.
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