Five new functions improve performance when you are computing with timestamps and dates that vary in records that are being processed . You can use the functions in the osh script of theTransform operator and in theTransformer stage.
To improve performance, one new function replaces two timestamp arguments.
|The new functions reduce the calculation time usually required when using the following functions:
The five new functions are:
Description: Returns the number of seconds between two timestamps
Arguments: timestamp, timestamp
Output: seconds (dfloat)
Description: Returns the timestamp that results from adding a number of seconds to a timestamp
Arguments: seconds (dfloat), timestamp
Description: Returns the timestamp that results from replacing the time of day part of the timestamp with the given time
Arguments: time, timestamp
Description: Returns the date that results from adding a number of days to a date
Arguments: days (int32), date
Description: Returns the number of days between two dates
Arguments: date, date
Output: days (int32)
Previously, you might use the expression:
InterVar0_0 = ustring_from_timestamp(DSLink3.a);
DSLink4.c = seconds_since_from_timestamp(DSLink3.b , InterVar0_0);
In the preceding example, the value is explicitly converted from timestamp (binary) to ustring for use in the call to the function seconds_since_from_timestamp. Then in the function the ustring is converted back to timestamp so that the difference between the two timestamps can be computed.
With the new function, the expression is:
DSLink4.c = seconds_since_from_timestamp(DSLink3.b , DSLink3.a);
|Information Management||InfoSphere Information Server||AIX, HP-UX, Linux, Solaris, Windows||9.1|
Rate this page:
Copyright and trademark information
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.