Page 1 of 1

Function similar to Oconv in parallel jobs

Posted: Fri Apr 11, 2008 7:23 am
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.

Posted: Fri Apr 11, 2008 4:35 pm
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.

Posted: Tue Apr 15, 2008 2:27 am
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.

Posted: Tue Apr 15, 2008 5:29 am
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).

Posted: Thu Apr 17, 2008 2:35 am
by ssunda6
Thanks Ray.

TimeFromMidnightSeconds() is giving the right value.

Regards,
ssunda.