13.07.2015 Views

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>SAS</strong>/<strong>ACCESS</strong> Interface to Teradata 4 How It Works 817select put(zipcode,$region.) as region,sum(sales) as sum_sales from sales.customersgroup by region;The <strong>SAS</strong> SQL processor knows how to process the PUT function. Currently,<strong>SAS</strong>/<strong>ACCESS</strong> Interface to Teradata returns all rows of un<strong>for</strong>matted data in theSALES.CUSTOMERS table in the Teradata database to the <strong>SAS</strong> System <strong>for</strong> processing.The <strong>SAS</strong> In-Database technology deploys, or publishes, the PUT functionimplementation to Teradata as a new function named <strong>SAS</strong>_PUT( ). Similar to any otherprogramming language function, the <strong>SAS</strong>_PUT( ) function can take one or more inputparameters and return an output value.The <strong>SAS</strong>_PUT( ) function supports use of <strong>SAS</strong> <strong>for</strong>mats. You can specify the<strong>SAS</strong>_PUT( ) function in SQL queries that <strong>SAS</strong> submits to Teradata in one of two ways:3 implicitly by enabling <strong>SAS</strong> to automatically map PUT function calls to <strong>SAS</strong>_PUT( )function calls3 explicitly by using the <strong>SAS</strong>_PUT( ) function directly in your <strong>SAS</strong> programIf you used the <strong>SAS</strong>_PUT( ) function in the previous example, Teradata <strong>for</strong>mats theZIP code values with the $REGION <strong>for</strong>mat and processes the GROUP BY clause usingthe <strong>for</strong>matted values.By publishing the PUT function implementation to Teradata as the <strong>SAS</strong>_PUT( )function, you can realize these advantages:3 You can process the entire SQL query inside the database, which minimizes datatransfer (I/O).3 The <strong>SAS</strong> <strong>for</strong>mat processing leverages the scalable architecture of the DBMS.3 The results are grouped by the <strong>for</strong>matted data and are extracted from theTeradata Enterprise Data Warehouse (EDW).Deploying <strong>SAS</strong> <strong>for</strong>mats to execute inside a Teradata database can enhanceper<strong>for</strong>mance and exploit Teradata parallel processing.How It WorksBy using the <strong>SAS</strong> <strong>for</strong>mats publishing macro, you can generate a <strong>SAS</strong>_PUT( ) functionthat enables you to execute PUT function calls inside the Teradata EDW. You canreference the <strong>for</strong>mats that <strong>SAS</strong> supplies and most custom <strong>for</strong>mats that you create byusing PROC FORMAT.The <strong>SAS</strong> <strong>for</strong>mats publishing macro takes a <strong>SAS</strong> <strong>for</strong>mat catalog and publishes it tothe Teradata EDW. Inside the Teradata EDW, a <strong>SAS</strong>_PUT( ) function, which emulatesthe PUT function, is created and registered <strong>for</strong> use in SQL queries.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!