Function similar to Oconv in parallel 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
ssunda6
Participant
Posts: 91
Joined: Tue Sep 19, 2006 9:32 pm

Function similar to Oconv in parallel jobs

Post by ssunda6 »

Hi All,

I searched the forum but did not get required information.

Iam getting a time value from input file. (e.g., 065535). In the server job, the function Oconv(columnname,"MTS") is being used and the output corresponding value is 18:12:15

Now we are implementing the same as parallel job and Oconv function is not available in parallel jobs. How do I convert the given value to the output value similar to server job.

Thanks in advance,
ssunda.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You use appropriate data type conversion functions, such as StringToDate() and DateToString(). The format string supplied with each of these specifies how the string is formatted.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ssunda6
Participant
Posts: 91
Joined: Tue Sep 19, 2006 9:32 pm

Post by ssunda6 »

Hi Ray,

I tried using StringToTime and TimeToString functions with the following syntax:

Code: Select all

date1=StringToTime(input,"%hh%nn%ss")
output=TimeToString(date1,"%hh:%nn:%ss")
For input value 065535 , the above functions result is given below

Code: Select all

date1:065535 output:06:55:35
But I want the output value as "18:12:15" for the given input value ( Oconv in server job returns this output)

Regards,
ssunda.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Stop thinking like a server developer. Oconv is treating 065535 as the number of seconds since midnight. Try the TimeFromSecondsSince() function (I'm guessing the name, so be flexible).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ssunda6
Participant
Posts: 91
Joined: Tue Sep 19, 2006 9:32 pm

Post by ssunda6 »

Thanks Ray.

TimeFromMidnightSeconds() is giving the right value.

Regards,
ssunda.
Post Reply