Time series API routines sorted by task

Time series API routines are sorted into logical areas based on the type of task.

The following table shows the time series interface routines listed by task type. An uppercase routine name, such as TS_ELEM_NULL, denotes a macro.
Table 1. Time series API routines sorted by task
Task type Description
Open and close a time series Open a time series: The ts_open() function

Close a time series: The ts_close() function

Return a pointer to the time series associated with the specified time series descriptor: The ts_get_ts() function

Create and copy a time series Create a time series: The ts_create() function

Create a time series with metadata: The ts_create_with_metadata() function

Copy a time series: The ts_copy() function

Free all memory associated with a time series created with ts_copy() or ts_create(): The ts_free() procedure

Copy all elements of one time series into another: The ts_put_ts() function

Scan a time series Start a scan: The ts_begin_scan() function

Retrieve the next element from a scan: The ts_next() function

End a scan: The ts_end_scan() procedure

Find the time stamp of the last element retrieved from a scan: The ts_current_timestamp() function

Return the offset for the last element returned by ts_next() (regular time series): The ts_current_offset() function

Make elements visible or invisible to a scan Make an element invisible: The ts_hide_elem() function

Make an element visible: The ts_reveal_elem() function

Select individual elements from a time series Get the element closest to a specified time stamp: ids_tms_293.html

Get the element associated with a specified time stamp: The ts_elem() function

Get the element at a specified position: The ts_nth_elem() function

Get the first element: The ts_first_elem() function

Get the last element: The ts_last_elem() function

Find the next element after a specified time stamp: The ts_next_valid() function

Find the last element before a specified time stamp: The ts_previous_valid() function

Find the last element at or before a specified time stamp: The ts_last_valid() function

Update a time series Insert an element: The ts_ins_elem() function

Update an element: The ts_upd_elem() function

Delete an element: The ts_del_elem() function

Put an element in a place specified by a time stamp: The ts_put_elem() function and The ts_put_elem_no_dups() function

Append an element (regular time series): The ts_put_last_elem() function

Put an element in a place specified by an offset (regular time series): The ts_put_nth_elem() function

Modify metadata Update metadata: The ts_update_metadata() function
Convert between an index and a time stamp Convert time stamp to index (regular time series): The ts_index() function

Convert index to time stamp (regular time series): The ts_time() function

Transform an element Create an element from an array of values and nulls: The ts_make_elem() function and The ts_make_elem_with_buf() function

Convert an MI_ROW value to an element: The ts_row_to_elem() function

Convert an element to an MI_ROW value: The ts_elem_to_row() function

Free memory from a time series element created by ts_make_elem() or ts_row_to_elem(): The ts_free_elem() procedure

Extract column data from an element Get a column from an element by name: The ts_colinfo_name() function

Get a column from an element by number: The ts_colinfo_number() function

Pull columns from an element into values and nulls arrays: The ts_get_all_cols() procedure

Create and perform calculations with time stamps Compare two time stamps: The ts_datetime_cmp() function

Get fields from a time stamp: The ts_get_stamp_fields() procedure

Create a time stamp: The ts_make_stamp() function

Calculate the number of intervals between two time stamps: The ts_tstamp_difference() function

Subtract N intervals from a time stamp: The ts_tstamp_minus() function

Add N intervals to a time stamp: The ts_tstamp_plus() function

Get information about element data Find the number of a column: The ts_col_id() function

Return the number of columns contained in each element: The ts_col_cnt() function

Get type information for a column specified by number: The ts_colinfo_number() function

Get type information for a column specified by name: The ts_colinfo_name() function

Determine whether an element is hidden: The TS_ELEM_HIDDEN macro

Determine whether an element is NULL: The TS_ELEM_NULL macro

Get information about a time series Get the name of a calendar associated with a time series: The ts_get_calname() function

Return the number of elements in a time series: The ts_nelems() function

Return the flags associated with the time series: The ts_get_flags() function

Get the name of the container: The ts_get_containername() function

Determine whether the time series is in a container: The TS_IS_INCONTAINER macro

Get the origin of the time series: The ts_get_origin() function

Get the metadata associated with the time series: The ts_get_metadata() function

Determine whether the time series is irregular: The TS_IS_IRREGULAR macro

Determine whether a time series contains packed data: The ts_get_packed() function

Get the frequency of hertz data: The ts_get_hertz() function

Get the compression type of compressed data: The ts_get_compressed() function

Get information about a calendar Return the number of valid intervals between two time stamps: The ts_cal_index() function

Return all valid timepoints between two time stamps: The ts_cal_range() function

Return a specified number of time stamps starting at a specified time stamp: The ts_cal_range_index() function

Return the time stamp at a specified number of intervals after a specified time stamp: The ts_cal_stamp() function

The following functions are used only with regular time series:
  • ts_current_offset()
  • ts_index()
  • ts_nth_elem()
  • ts_put_last_elem()
  • ts_put_nth_elem()
  • ts_time()
Some of the API routines are much the same as SQL routines. The mapping is shown in the following table.
API routine SQL routine
ts_cal_index() CalIndex
ts_cal_range() CalRange
ts_cal_stamp() CalStamp
ts_create() TSCreate, TSCreateIrr
ts_create_with_metadata() TSCreate, TSCreateIrr
ts_del_elem() DelElem
ts_elem() GetElem
ts_first_elem() GetFirstElem
ts_get_calname() GetCalendarName
ts_get_containername() GetContainerName
ts_get_metadata() GetMetaData
ts_get_origin() GetOrigin
ts_hide_elem() HideElem
ts_index() GetIndex
ts_ins_elem() InsElem
ts_last_elem() GetLastElem
ts_nelems() GetNelems
ts_next_valid() GetNextValid
ts_nth_elem() GetNthElem
ts_previous_valid() GetPreviousValid
ts_put_elem() PutElem
ts_put_elem_no_dups() PutElemNoDups
ts_put_ts() PutTimeSeries
ts_reveal_elem() RevealElem
ts_time() GetStamp
ts_update_metadata() UpdMetaData
ts_upd_elem() UpdElem