InfoSphere DataStage: new functions improve performance when computing timestamps and dates that are not constant



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:
  • seconds_since_from_timestamp(EndTime, StartTime)
  • timestamp_from_seconds_since()
  • timestamp_from_time()
  • date_from_days_since()
  • days_since_from_date()

The five new functions are:

Function: seconds_since_from_timestamp2
Description: Returns the number of seconds between two timestamps
Arguments: timestamp, timestamp
Output: seconds (dfloat)

Function: timestamp_from_seconds_since2
Description: Returns the timestamp that results from adding a number of seconds to a timestamp
Arguments: seconds (dfloat), timestamp
Output: timestamp

Function: timestamp_from_time2
Description: Returns the timestamp that results from replacing the time of day part of the timestamp with the given time
Arguments: time, timestamp
Output: timestamp

Function: date_from_days_since2
Description: Returns the date that results from adding a number of days to a date
Arguments: days (int32), date
Output: date

Function: days_since_from_date2
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);

Cross reference information
Segment Product Component Platform Version Edition
Information Management InfoSphere Information Server AIX, HP-UX, Linux, Solaris, Windows 9.1

Rate this page:

(0 users)Average rating

Document information

More support for:

InfoSphere DataStage

Software version:


Operating system(s):

AIX, HP-UX, Linux, Solaris, Windows

Reference #:


Modified date:


Translate my page

Machine Translation

Content navigation