Page 1 of 1

convert the string to date type in parallele jobs

Posted: Tue Nov 14, 2006 10:57 am
by kira bob
how to convert the string to date type in parallele jobs for example i need to convert to:

20061107 to 11/07/2006 similarly string to time example: 113544 to 11:35:44 (hh:mm:ss).
let me know the complete logical expression how we will apply the transformer rule in the "TRANSFORMER STAGE"

thx,kiran

Posted: Tue Nov 14, 2006 11:24 am
by ArndW
Please look at the Parallel Job Developer's Guide page 1101, in the chapter "Type Conversion Functions" or use the search facility in the bar above the response and search for this type of function. The question has been asked and answered many, many times before.

This question does not belong in the FAQ section, but in the Parallel Job section.

Posted: Tue Nov 14, 2006 1:40 pm
by chandra
writein subroutine the same logic what ever you are using in transformer . It will improve the perfromance.

Posted: Tue Nov 14, 2006 1:43 pm
by ray.wurlod
Chandra, do you have any measurements to prove this assertion? IBM claims to have made substantial performance improvements to the Transformer stage in version 7.5.1.

Posted: Wed Nov 15, 2006 10:49 am
by Krazykoolrohit
chandra wrote:writein subroutine the same logic what ever you are using in transformer . It will improve the perfromance.
I thought routines degraded the performance. :oops:

Posted: Wed Aug 27, 2008 5:59 am
by sandeepgs
Hi

When your target is a sequential file then this is the solution...

Date conversion:

I/P: Ex:20061107
TransRule: StringToDate(<Input Col>,"%yyyy%mm%dd")
Change the properties of the sequential file.Set Date formatt string to your require formatt Ex:%mm/%dd/%yyyy
O/P:11/07/2006

Note: when converting string to date the input formatt and the formatt string you r providing should be same.
ex: I/P:20061107 Formatt String:%yyyy%mm%dd

Time conversion:

I/P: Ex:112244
Transformation Rule: StringToTime(<Input Col>,"%hh%nn%ss")
If you want to change the output formatt Change the properties of the sequential file.Set output time formatt string to your required formatt
Ex:%hh:%nn:%ss
O/P: 11:22:44

Note: when converting string to time the input formatt and the formatt string you r providing should be same.
ex: I/P:112244 Formatt String:%hh%nn%ss