<?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: Generating DDL for SAS Tables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Generating-DDL-for-SAS-Tables/m-p/68838#M14936</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, PeterC and Ksharp's approaches above create the clone table without giving you the DDL. To get the DDL you can :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;describe table sashelp.class;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then use the DDL commands written to the log to create the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 May 2012 15:48:28 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2012-05-10T15:48:28Z</dc:date>
    <item>
      <title>Generating DDL for SAS Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generating-DDL-for-SAS-Tables/m-p/68835#M14933</link>
      <description>Is there an easy way to generate the DDL for an existing SAS table?  I'm wanting to create an empty clone of an existing SAS table in a different database.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!</description>
      <pubDate>Thu, 03 Feb 2011 17:59:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generating-DDL-for-SAS-Tables/m-p/68835#M14933</guid>
      <dc:creator>rmwachter</dc:creator>
      <dc:date>2011-02-03T17:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Generating DDL for SAS Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generating-DDL-for-SAS-Tables/m-p/68836#M14934</link>
      <description>Clone:&lt;BR /&gt;
proc append base= newlib.newtable data= oldlib.oldtable(obs=0) ;&lt;BR /&gt;
run;</description>
      <pubDate>Thu, 03 Feb 2011 18:02:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generating-DDL-for-SAS-Tables/m-p/68836#M14934</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-02-03T18:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Generating DDL for SAS Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generating-DDL-for-SAS-Tables/m-p/68837#M14935</link>
      <description>Or &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sql feedback;&lt;BR /&gt;
 create table clone like sashelp.class;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Wed, 23 Feb 2011 05:18:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generating-DDL-for-SAS-Tables/m-p/68837#M14935</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-02-23T05:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Generating DDL for SAS Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generating-DDL-for-SAS-Tables/m-p/68838#M14936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, PeterC and Ksharp's approaches above create the clone table without giving you the DDL. To get the DDL you can :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;describe table sashelp.class;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then use the DDL commands written to the log to create the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2012 15:48:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generating-DDL-for-SAS-Tables/m-p/68838#M14936</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-05-10T15:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Generating DDL for SAS Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generating-DDL-for-SAS-Tables/m-p/68839#M14937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would have to recommend using the method presented by Peter.&amp;nbsp; The code below will provide insight into why:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql feedback codegen flow;&lt;/P&gt;&lt;P&gt;create table temp (&lt;/P&gt;&lt;P&gt;&amp;nbsp; a num&amp;nbsp; primary key,&lt;/P&gt;&lt;P&gt;&amp;nbsp; b char check (b in ('A','B','C')),&lt;/P&gt;&lt;P&gt;&amp;nbsp; c num&amp;nbsp; not null,&lt;/P&gt;&lt;P&gt;&amp;nbsp; d num,&lt;/P&gt;&lt;P&gt;&amp;nbsp; e char unique );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; * check clause constraints are not represented in ddl;&lt;/P&gt;&lt;P&gt;&amp;nbsp; describe table temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; * no index or constraints are duplicated;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table temp2 like temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; describe table temp2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; describe table constraints temp2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; insert into temp (a,b,c,d,e)&lt;/P&gt;&lt;P&gt;&amp;nbsp; values (1,'A',2,3,'!');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc append base=new data=temp(obs=0); run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;*now I have everything cloned;&lt;/P&gt;&lt;P&gt;describe table new;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*I did not get data because obs=0 in proc append;&lt;/P&gt;&lt;P&gt;select * from new;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are additional options as well, proc copy and proc datasets should be able to clone as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2012 18:09:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generating-DDL-for-SAS-Tables/m-p/68839#M14937</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-05-10T18:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: Generating DDL for SAS Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generating-DDL-for-SAS-Tables/m-p/68840#M14938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a nice piece of reference material to what I discuss:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000403555.htm"&gt;http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000403555.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2012 19:05:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generating-DDL-for-SAS-Tables/m-p/68840#M14938</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-05-10T19:05:46Z</dc:date>
    </item>
  </channel>
</rss>

