StringtoTimestamp + Substring

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
DS_MJ
Participant
Posts: 157
Joined: Wed Feb 02, 2005 10:00 am

StringtoTimestamp + Substring

Post by DS_MJ »

Hello All:

I have in my job properties - Parameters the following:

EXTRACTSTARTDT String 19000101000000000
EXTRACTENDDT String 20060906123746890

Target Table (MSSQL)
Target_column_Name Timestamp 23,3 (Len,Scale)

I am trying the to load the Parameters into the target table by using substring along with stringtotimestamp. However the end part is totally lost cause I am trying to mix server into Px job. Please help to rectify:

Thanks in advance.

Code: Select all

Stringtotimestamp(Substrings(EXTRACTENDDT[1,4]):'-':Substrings(EXTRACTSTARTDT[5,2]):'-':Substrings(EXTRACTSTARTDT[7,2],"D-YMD[4,2,2]"):"00:00:00","%yyyy-%mm-%dd %hh:%nn:%ss") 
Thanks in advance,
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Just lose the Substrings() functions - the square bracket notation is sufficient to represent substringing. Also lose the Oconv() specification!

Code: Select all

StringToTimestamp(EXTRACTENDDT[1,4]:'-':EXTRACTSTARTDT[5,2]:'-':EXTRACTSTARTDT[7,2]:" 00:00:00.000","%yyyy-%mm-%dd %hh:%nn:%ss.3") 
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DS_MJ
Participant
Posts: 157
Joined: Wed Feb 02, 2005 10:00 am

Post by DS_MJ »

ray.wurlod wrote:Just lose the Substrings() functions - the square bracket notation is sufficient to represent substringing. Also lose the Oconv() specification!

Code: Select all

StringToTimestamp(EXTRACTENDDT[1,4] ...[/quote]

Thanks Ray.
Thanks in advance,
Post Reply