SAS/ACCESS Interface to Teradata supports the TPT API for loading and reading data. The TPT API provides a consistent interface for FastLoad, FastExport, MultiLoad, and Multi-Statement insert. TPT API documentation refers to FastLoad as the Load operator, FastExport as the Export operator, MultiLoad as the Update operator, and Multi-Statement insert as the Stream operator. The ability to restart is supported by FastLoad, MultiLoad, and Multi-Statement insert.
Here are the requirements for using the TPT API in SAS for loading SAS.
The SAS configuration document for your system contains information about how to configure SAS to work with the TPT API. However, those steps might already have been completed as part of the post-installation configuration process for your site.
These LIBNAME options are common to all three supported load methods:
For releases prior to SAS 9.4M9, if SAS cannot use the TPT API, it reverts to using FastLoad, MultiLoad, or Multi-Statement insert, depending on which method of loading was requested without generating any errors.
These data set options are common to all three supported load methods:
You can use the DBCOMMIT= LIBNAME option and the CHECKPOINT= data set option to specify checkpoint frequency with TPT FastLoad, TPT MultiLoad, and TPT Multi-Statement insert. These options are not relevant with TPT FastExport. SAS sets TPT_MAX_SESSIONS to 4. For releases prior to SAS 9.4M9, these options are disabled for the non-TPT MultiLoad interface.
SAS/ACCESS automatically verifies that your Teradata environment is configured to process response row sizes up to 1MB. Typically, the required versions of the Teradata client libraries, Teradata TTU, and Teradata Vantage SQL Engine all support row sizes of 1MB.
The Teradata legacy utilities—FastLoad, MultiLoad, MultiStatement, and FastExport—all support row sizes up to 1MB as long as the LIBNAME option TPT= is set to YES (the default).
If you use the default values for TPT-related options, then the maximum row size is 1MB. You can restrict the maximum row size to 64K by setting the TD_1MB_ROW environment variable to OFF. For more information, see TD_1MB_ROW Environment Variable in SAS Global Statements: Reference.
SAS/ACCESS Interface to Teradata supports the TPT API for FastLoad, also known as the Load operator. SAS/ACCESS works by interfacing with the Load operator through the TPT API, which in turn uses the Teradata FastLoad protocol for loading data. See your Teradata documentation for more information about the Load operator.
SAS/ACCESS uses the TPT API to implement the TPT FastLoad utility. SAS/ACCESS can restart TPT FastLoad from checkpoints. The TPT FastLoad utility has these limitations:
See the SAS configuration document for instructions on setting up the environment so that SAS can find the TPT API modules.
You can use these options to start FastLoad in the SAS/ACCESS interface using the TPT API:
These data set options are specific to FastLoad using the TPT API:
SAS/ACCESS Interface to Teradata supports the TPT API for MultiLoad, also known as the Update operator. SAS/ACCESS works by interfacing with the Update operator through the TPT API. This API then uses the Teradata MultiLoad protocol for loading data. See your Teradata documentation for more information about the Update operator.
SAS/ACCESS can restart MultiLoad from checkpoints when it uses the TPT API.
The SAS/ACCESS MultiLoad facility loads both empty and existing Teradata tables. SAS/ACCESS supports only Insert operations and loading only one target table at a time.
To use the TPT MultiLoad facility, you must specify these items on target tables before the load operation:
Errors are logged to Teradata tables. Error recovery can be difficult if you do not set TPT_CHECKPOINT_DATA= to enable restart from the last checkpoint. To find the error that corresponds to the code that is stored in the error table, see your Teradata documentation. You can restart a failed job for the last checkpoint by following the instructions in the SAS error log.
See the SAS configuration document for instructions on setting up the environment so that SAS can find the TPT API modules.
You can use these options to start MultiLoad in the SAS/ACCESS interface using the TPT API:
These LIBNAME options are specific to MultiLoad using the TPT API:
These data set options are specific to MultiLoad using the TPT API:
SAS/ACCESS Interface to Teradata supports the TPT API for Multi-Statement insert, also known as the Stream operator. SAS/ACCESS works by interfacing with the Stream operator through the TPT API, which in turn uses the Teradata Multi-Statement insert (TPump) protocol for loading data. See your Teradata documentation for more information about the Stream operator.
SAS/ACCESS can restart Multi-Statement insert from checkpoints when Multi-Statement insert uses the TPT API.
The SAS/ACCESS Multi-Statement insert facility loads both empty and existing Teradata tables. SAS/ACCESS supports only Insert operations and loading only one target table at time.
Errors are logged to Teradata tables. Error recovery can be difficult if you do not set TPT_CHECKPOINT_DATA= to enable restart from the last checkpoint. To find the error that corresponds to the code that is stored in the error table, see your Teradata documentation. You can restart a failed job for the last checkpoint by following the instructions on the SAS error log.
See the SAS configuration document for instructions on setting up the environment so that SAS can find the TPT API modules.
You can use these options to start Multi-Statement in the SAS/ACCESS interface using the TPT API:
These LIBNAME options also work with the Multi-Statement Insert:
These data set options are specific to Multi-Statement insert using the TPT API.
If the TPT API is not available, SAS/ACCESS Interface to Teradata provides the following facilities. Although these are legacy facilities, they do improve performance when loading data. These correspond to native Teradata utilities.
For more information, see the following sections.
SAS/ACCESS Interface to Teradata supports FastLoad, a native Teradata bulk-load utility that greatly accelerates inserting data into empty Teradata tables. For general information about using FastLoad and error recovery, see the Teradata FastLoad documentation.
If you do not specify FastLoad, then your Teradata tables are loaded normally. To start non-TPT FastLoad in the SAS/ACCESS interface, you can use one of these methods:
Here are the data set options that you can use with the non-TPT FastLoad facility.
BL_LOG=my_load_errors,
errors are logged in tables
my_load_errors1 and
my_load_errors2.
For details, see About the Data Set Options for Relational Databases.
SAS/ACCESS Interface to Teradata supports a bulk-load capability called MultiLoad that accelerates insertion of data into Teradata tables. For general information about using MultiLoad with Teradata tables and for information about error recovery, see the Teradata MultiLoad documentation.
Unlike FastLoad, which loads only empty tables, MultiLoad loads both empty and existing Teradata tables. If you do not specify MultiLoad, your Teradata tables are loaded normally (inserts are sent one row at a time).
The non-TPT MultiLoad facility loads both empty and existing Teradata tables. SAS/ACCESS supports these features:
Because the non-TPT MultiLoad facility is similar to the native Teradata MultiLoad utility, they share a limitation: You must specify these items on the target tables before the load:
Both the Teradata MultiLoad utility and the non-TPT MultiLoad facility log data errors to tables. Error recovery can be difficult, but the ability to restart from the last checkpoint is possible. To find the error that corresponds to the code that is stored in the error table, see the Teradata MultiLoad documentation.
Here are the requirements for using the non-TPT MultiLoad bulk-load capability in SAS.
If not already done during post-installation configuration, see the SAS configuration documentation for your system for information about how to configure SAS to work with MultiLoad.
Call the non-TPT MultiLoad facility by specifying MULTILOAD=YES. See the MULTILOAD= data set option for detailed information and examples on loading data and recovering from errors during the load process.
Here are the data set options that are available for use with the MultiLoad facility. For detailed information about these options, see Overview.
ML_LOG=MY_LOAD the
log table is named MY_LOAD_RS. Errors are
logged in tables MY_LOAD_ET and MY_LOAD_UT.
The work table is named MY_LOAD_WT. Be aware that these options are disabled while you are using the SAS/ACCESS MultiLoad facility.
To
see whether threaded Reads are actually generated, turn on SAS tracing
by specifying OPTIONS SASTRACE=",,,d" in
your program.
This example loads data using TPT FastLoad.
/* Check the SAS log for this message to verify that the TPT API was used.
NOTE: Teradata connection: TPT FastLoad has inserted 100 rows.
*/
data trlib.load(TPT=YES FASTLOAD=YES);
do x=1 to 1000;
output;
end;
run;
This example restarts a TPT MultiLoad step that records checkpoints and fails after loading 2000 rows of data.
proc append data=trlib.load(TPT=YES MULTILOAD=YES
TPT_RESTART=YES TPT_CHECKPOINT_DATA=2000)
data=work.inputdata(FIRSTOBS=2001);
run;