convert the string to date type in parallele jobs

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
kira bob
Participant
Posts: 7
Joined: Sun Oct 29, 2006 10:21 am
Location: Jp-Nagar
Contact:

convert the string to date type in parallele jobs

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
chandra
Participant
Posts: 88
Joined: Sun Apr 02, 2006 6:50 pm
Location: India

Post by chandra »

writein subroutine the same logic what ever you are using in transformer . It will improve the perfromance.
chandra ,
Hyd
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post 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:
sandeepgs
Participant
Posts: 87
Joined: Wed Jul 02, 2008 12:22 am

Post 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
Post Reply