DateTimestamp

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

Post by g_rkrish »

ray.wurlod wrote:Reorder the date components, and format into a timestamp. Simple string manipulation.

Code: Select all

Col1[5,2] : "/" : Col1[7,2] : "/" : Col1[1,4]  ...[/quote]

Still i get the error saying 
[color=red]DBMS.CODE=-180, SQLSTATE=22007, [IBM][CLI Driver][DB2/AIX64] SQL0180N  The syntax of the string representation of a datetime value is incorrect.  SQLSTATE=22007[/color]
RK
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

And therein lies the fundamental problem with how you approached this. You specified your 'required format' in your first post and so that's what people helped you build. The fact that it doesn't work is a whole 'nuther kettle of fish.

From what little I know about DB2, it seems to want date /time information in internal format. Can someone please confirm what this timestamp actually needs to look like in order to load properly into the target datetime field?
-craig

"You can never have too many knives" -- Logan Nine Fingers
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

Criag is right about it. Here is the how you can tweak this. Just remember what format you need at the output.

Code: Select all

OConv(IConv(Col1, "DYMD[4,2,2]"), "D/MDY[2,2,4]") : " " : OConv("Col2[1,2]:":":Col2[3,2]:":":Col2[5,2]", "MTS") 
With the given i/p's, you will get
08/09/2007 06:10:00 am
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

Post by g_rkrish »

chulett wrote:And therein lies the fundamental problem with how you approached this. You specified your 'required format' in your first post and so that's what people helped you build. The fact that it doesn't work is a whole 'nuther kettle of fish.

From what little I know about DB2, it seems to want date /time information in internal format. Can someone please confirm what this timestamp actually needs to look like in order to load properly into the target datetime field?
Craig,

I have the same formatted timestamp in my target database so i gave my requirement but as i am new to DB2UDB i thought that might be standered format also..so i don't really able to figure where the problem lies.....
RK
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

g_rkrish wrote:I have the same formatted timestamp in my target database
No, you don't. Whatever query tool you are using to view that data is showing it to you in that format - and that's got nothing to do with how it is stored. Or what's needed to load it. Someone more familiar with DB2 will need to let us know what the stage is expecting.
-craig

"You can never have too many knives" -- Logan Nine Fingers
g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

Post by g_rkrish »

chulett wrote:
g_rkrish wrote:I have the same formatted timestamp in my target database
No, you don't. Whatever query tool you are using to view that data is showing it to you in that format - and that's got nothing to do with how it is stored. Or what's needed to load it. Someone more familiar with DB2 will need to let us know what the stage is expecting.
Ok got it..there where i got it wrong. thanks craig for your explanation....
RK
Post Reply