﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Teradata Forums / Analytical Applications / Teradata   / SAS &amp; Primary Indexes / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>Teradata Forums</description><link>http://www.teradata.com/teradataforum/</link><webMaster>info@teradata.com</webMaster><lastBuildDate>Wed, 03 Dec 2008 15:33:11 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: SAS &amp; Primary Indexes</title><link>http://www.teradata.com/teradataforum/Topic9805-5-1.aspx</link><description>Basically, yes.  If you are have a connection to a Teradata data source using the SAS LIBNAME mechanism, you can use the "dbcreate_table_opts" SAS data set option to specify any table create option.  For example:libname DB1 teradata user="&amp;terauser" password="&amp;terapass"            schema=DB1 DBCOMMIT=0;libname DB2 some-other-data-source;         proc sql;   create table DB1.table1(dbcreate_table_opts='primary index(ssn)') as   SELECT name, ssn, address   FROM   db2.customers;quit;I'd further recommend that you look up the "dbtype" SAS data set option if you choose to do this.  That lets you explicitly define the column data types.Of course, doing it this way only makes sense if your DB2 library is NOT in the same Teradata environment.  In other words, if you're creating a Teradata table from a Teradata table, it's much better to use SAS's "pass-thru" facility, with which you can submit normal Teradata SQL:proc sql;   connect to teradata (user="&amp;terauser" password="&amp;terapass" mode=teradata);   execute ( /* Your original code follows */      CREATE SET TABLE db1.table1 AS      (SELECT name, ssn, address      FROM db2.customers)      WITH DATA      UNIQUE PRIMARY INDEX (ssn)   ) by teradata;quit;</description><pubDate>Mon, 03 Dec 2007 19:23:07 GMT</pubDate><dc:creator>bobduell</dc:creator></item><item><title>SAS &amp; Primary Indexes</title><link>http://www.teradata.com/teradataforum/Topic9805-5-1.aspx</link><description>Does SAS have the capability to explicitly specify a PI as a result of a select statement the way you can in TD?If you can do this in TD:CREATE SET TABLE db1.table1 AS(SELECT name, ssn, addressFROM db2.customers)WITH DATAUNIQUE PRIMARY INDEX (ssn);How do you do that in SAS - or can you?</description><pubDate>Tue, 20 Nov 2007 17:20:13 GMT</pubDate><dc:creator>mikejbritt</dc:creator></item></channel></rss>