TEMPORAL_QUALIFIER= LIBNAME Option

Specifies time-dimension criteria for retrieving data from Teradata.
Valid in: SAS/ACCESS LIBNAME statement
Default: CURRENT VALIDTIME [valid-time column], CURRENT TRANSACTIONTIME [transaction-time column]
Interaction: Specifying values in a DATA step overrides LIBNAME values.
Data source: Teradata
See: TEMPORAL_QUALIFIER= data set option

Syntax

TEMPORAL_QUALIFIER=CURRENT VALIDTIME
| VALIDTIME AS OF PERIOD 'period' | SEQUENCED VALIDTIME
| NONSEQUENCED VALIDTIME 'period'
TEMPORAL_QUALIFIER=CURRENT TRANSACTIONTIME
| TRANSACTIONTIME AS OF PERIOD 'period'
NONSEQUENCED TRANSACTIONTIME

Syntax Description

CURRENT VALIDTIME
selects rows that are valid at the current time.
VALIDTIME AS OF PERIOD 'period'
selects rows with valid-time periods that overlap the specified AS OF period. For the period, you can specify either a single date or a time period (date range) by specifying a start date and an end date.
SEQUENCED VALIDTIME PERIOD 'period'
selects history, current, or future rows that are valid for the specified time period.
NONSEQUENCED VALIDTIME PERIOD 'period'
treats the table as nontemporal.
CURRENT TRANSACTIONTIME
selects rows that are open in transaction time.
TRANSACTIONTIME AS OF 'period'
selects rows with transaction-time periods that overlap the specified AS OF period. For the period, you can specify either a single date or a time period (date range) by specifying a start date and an end date.
NONSEQUENCED TRANSACTIONTIME PERIOD 'period'
treats the table as nontemporal.

Details

Use temporal qualifiers to specify time criteria for selecting data from temporal tables.
Temporal qualifiers that you specify in a LIBNAME statement apply only to that Teradata session and are implemented through session commands that are issued at connect time. For example, if you specify TEMPORAL_QUALIFIER='AS OF PERIOD '(1999-01-01, 2099-01-05)' ' in a LIBNAME statement, below is the Teradata SET SESSION command that is issued at connect time. The SQL is submitted as usual.
.SET SESSION ASOF PERIOD '(1999-01-01, 2099-01-05)'

Example: Select Valid-Time Rows for a Specific Date for the Current Session

In this example, valid-time rows are selected for a specific date from the mytest data set.
/* Consider data as of 1995-01-01. */
libname x teradata user=testuser pw=testpw server=td1310
        TEMPORAL_QUALIFIER='VALIDTIME AS OF DATE '1995-01-01' '

/* .SET SESSION VALIDTIME ASOF DATE'1995-01-01'; is issued 
   before submitting the SQL "Select * from mytest" */
proc print data=x.mytest(DBSLICEPARM=ALL);
run;