Concatination of Date and Time

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
Ratan Babu N
Participant
Posts: 34
Joined: Tue Dec 27, 2005 12:13 am

Concatination of Date and Time

Post by Ratan Babu N »

Hi,
I am new to Datastage. I have an issue. It would be great If any one help me out.
I am getting the date field and time field in two different attributes. how can i Concatinate both the fields so that i can store the timestamp in the target.( i tried out concatinate ( : ) operator in the transformer stage but i didnot get the intended result
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You are using DataStage PX, so you will need to maintain correct data types in all stages. If your incoming Date and Time columns are strings you can concatenate them together, but then you need to call a datatype conversion routine to convert them to the target datatype. Note that date and timestamp datatypes are different in Oracle, DB/2 and Sybase and you need to know which type you are dealing with in order to choose the correct conversion.
Sunshine2323
Charter Member
Charter Member
Posts: 130
Joined: Mon Sep 06, 2004 3:05 am
Location: Dubai,UAE

Post by Sunshine2323 »

StringToTimestamp(DSLink3.DateField:' ':DSLink3.TimeField,"%dd-%mm-%yyyy %hh:%nn")
Warm Regards,
Amruta Bandekar

<b>If A equals success, then the formula is: A = X + Y + Z, X is work. Y is play. Z is keep your mouth shut. </b>
--Albert Einstein
Raog
Participant
Posts: 8
Joined: Thu Oct 13, 2005 8:53 am

Re: Concatination of Date and Time

Post by Raog »

Hi,

What is your input field datatype. As Arnd suggested, u have to convert them to char type(If they are not char data type) before concatenating . Once u concatenated, u can convert to whatever data type you have in the target

Rgds,
Rao.

Ratan Babu N wrote:Hi,
I am new to Datastage. I have an issue. It would be great If any one help me out.
I am getting the date field and time field in two different attributes. how can i Concatinate both the fields so that i can store the timestamp in the target.( i tried out concatinate ( : ) operator in the transformer stage but i didnot get the intended result
ameyvaidya
Charter Member
Charter Member
Posts: 166
Joined: Wed Mar 16, 2005 6:52 am
Location: Mumbai, India

Post by ameyvaidya »

Hi Ratan,
If you ned to generate a Timestamp from DATE and TIME fields, Read up on the

Code: Select all

TimestampFromDateTime
Function on Page 1092 of the Parallel Job Developers Guide.

IHTH
Amey Vaidya<i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
Post Reply