<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Best Way to build SQL statement from a describe table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Best-Way-to-build-SQL-statement-from-a-describe-table/m-p/293832#M61234</link>
    <description>Perhaps you should look for Teradata tools instead...</description>
    <pubDate>Wed, 24 Aug 2016 19:45:06 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2016-08-24T19:45:06Z</dc:date>
    <item>
      <title>Best Way to build SQL statement from a describe table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Best-Way-to-build-SQL-statement-from-a-describe-table/m-p/293768#M61215</link>
      <description>&lt;P&gt;In teradata, you can see the table definition by running a show table xxx to get the contents on how it was created.&amp;nbsp; In SAS you can also run this same code that writes out the contents to a table or perform a describe xxx which produces the code in a log.&amp;nbsp; what i was looking to do is utilize SAS to read this code to recreate the table to perform a comparison on another table.&amp;nbsp; The columns could always change so i want to make it as dynamic as possible.&amp;nbsp; Waht would be the most efficient way to build a new table off of the describe statement.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 16:17:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Best-Way-to-build-SQL-statement-from-a-describe-table/m-p/293768#M61215</guid>
      <dc:creator>jbanas</dc:creator>
      <dc:date>2016-08-24T16:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: Best Way to build SQL statement from a describe table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Best-Way-to-build-SQL-statement-from-a-describe-table/m-p/293773#M61217</link>
      <description>&lt;P&gt;If you just want to create a new table that has the same structure as the old table, you can use&lt;/P&gt;
&lt;PRE&gt;create table newTable like oldTable;&lt;/PRE&gt;
&lt;P&gt;See also this sample code here:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data newCars;
  seqNr = _n_;
  set sashelp.cars;
run;

proc sql;
  create index seqNr on newcars;
  describe table newCars;
  create table newCars2 like newCars;
  describe table newCars;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 16:35:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Best-Way-to-build-SQL-statement-from-a-describe-table/m-p/293773#M61217</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-08-24T16:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Best Way to build SQL statement from a describe table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Best-Way-to-build-SQL-statement-from-a-describe-table/m-p/293780#M61219</link>
      <description>Thanks for the reply Bruno, ultimately I would take the column attributes that would build the table on Teradata&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Aug 2016 17:00:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Best-Way-to-build-SQL-statement-from-a-describe-table/m-p/293780#M61219</guid>
      <dc:creator>jbanas</dc:creator>
      <dc:date>2016-08-24T17:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Best Way to build SQL statement from a describe table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Best-Way-to-build-SQL-statement-from-a-describe-table/m-p/293832#M61234</link>
      <description>Perhaps you should look for Teradata tools instead...</description>
      <pubDate>Wed, 24 Aug 2016 19:45:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Best-Way-to-build-SQL-statement-from-a-describe-table/m-p/293832#M61234</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-08-24T19:45:06Z</dc:date>
    </item>
  </channel>
</rss>

