LASR Procedure

Example 4: Load a Table from Teradata to Memory

Details

This PROC LASR example demonstrates how to load a table to memory from Teradata. The native database client for Teradata and SAS/ACCESS Interface to Teradata must be installed and configured on the client machine.
option set=GRIDHOST="grid001.example.com"; 
option set=GRIDINSTALLLOC="/opt/TKGrid_REP";

libname tdlib teradata server="dbccop1.example.com" 1
    database=hps user=dbc password=dbcpass;

proc lasr create port=10010 data=tdlib.tableone noclass;  2
    performance nodes=all;
run;

proc lasr add data=tdlib.tabletwo (label = "Table description") 3
    port=10010; 
    format revenue dollar20.2
           units comma9; 4
run;

libname example sasiola port=10010 tag="tdlib"; 5

proc imstat;
  tableinfo / host="grid001.example.com" port=10010;
run;
  table example.tableone;  6
  columninfo;
quit;

Program Description

  1. The SERVER= option in the LIBNAME statement specifies the host name for the Teradata database.
  2. The first PROC LASR statement uses the CREATE option to start a server on network port 10010. The DATA= option is used to load table tableOne from Teradata into the server.
  3. The input data set option, LABEL=, associates the description with the data in the server instance. This option causes a warning in the SAS log because the SAS/ACCESS Interface to Teradata does not support data set labels.
  4. SAS formats are applied with the FORMAT statement. Specifying the variable formats is useful for DBMS tables because database systems do not store formats.
  5. The SASIOLA LIBNAME statement is used to access the tables in the server. The TAG= option is set to Tdlib so that it matches the libref that was used in the PROC LASR statements when tables were loaded into the server.
  6. The Example libref is used with the IMSTAT procedure to access tables in the server.