Page 1 of 1

Concatination of Date and Time

Posted: Wed Mar 08, 2006 3:16 am
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

Posted: Wed Mar 08, 2006 3:26 am
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.

Posted: Wed Mar 08, 2006 4:44 am
by Sunshine2323
StringToTimestamp(DSLink3.DateField:' ':DSLink3.TimeField,"%dd-%mm-%yyyy %hh:%nn")

Re: Concatination of Date and Time

Posted: Wed Mar 08, 2006 3:59 pm
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

Posted: Wed Mar 08, 2006 10:47 pm
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