<?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: How to create a sas data set from data definition language. in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/485937#M31485</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76331"&gt;@alepage&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems possible to generate the DDL from a SAS table as follow:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;describe&lt;/FONT&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sashelp.class;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Then we go in the log file and we get this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;create table SASHELP.CLASS( label='Student Data' bufsize=65536 )&lt;/P&gt;
&lt;P&gt;(&lt;/P&gt;
&lt;P&gt;Name char(8),&lt;/P&gt;
&lt;P&gt;Sex char(1),&lt;/P&gt;
&lt;P&gt;Age num,&lt;/P&gt;
&lt;P&gt;Height num,&lt;/P&gt;
&lt;P&gt;Weight num&lt;/P&gt;
&lt;P&gt;);&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can I import the DDL into&amp;nbsp; SAS to generate the data set and if so, how can we do that?&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;Use LIKE&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Proc sql;
Create table want &lt;FONT size="5" color="#800080"&gt;&lt;STRONG&gt;like&lt;/STRONG&gt;&lt;/FONT&gt; SAShelp.class;
Quit;&lt;/PRE&gt;
&lt;P&gt;Then check the table called WANT.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Aug 2018 20:17:21 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-08-10T20:17:21Z</dc:date>
    <item>
      <title>How to create a sas data set from data definition language.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/485928#M31480</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems possible to generate the DDL from a SAS table as follow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;describe&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sashelp.class;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Then we go in the log file and we get this:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;create table SASHELP.CLASS( label='Student Data' bufsize=65536 )&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;Name char(8),&lt;/P&gt;&lt;P&gt;Sex char(1),&lt;/P&gt;&lt;P&gt;Age num,&lt;/P&gt;&lt;P&gt;Height num,&lt;/P&gt;&lt;P&gt;Weight num&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can I import the DDL into&amp;nbsp; SAS to generate the data set and if so, how can we do that?&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 19:49:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/485928#M31480</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2018-08-10T19:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a sas data set from data definition language.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/485929#M31481</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76331"&gt;@alepage&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems possible to generate the DDL from a SAS table as follow:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;describe&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sashelp.class;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Then we go in the log file and we get this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;create table SASHELP.CLASS( label='Student Data' bufsize=65536 )&lt;/P&gt;
&lt;P&gt;(&lt;/P&gt;
&lt;P&gt;Name char(8),&lt;/P&gt;
&lt;P&gt;Sex char(1),&lt;/P&gt;
&lt;P&gt;Age num,&lt;/P&gt;
&lt;P&gt;Height num,&lt;/P&gt;
&lt;P&gt;Weight num&lt;/P&gt;
&lt;P&gt;);&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can I import the DDL into&amp;nbsp; SAS to generate the data set and if so, how can we do that?&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Describe what you want as output.&lt;/P&gt;
&lt;P&gt;If you want a data set of the same structure but no actual values, variable names, order, formats, labels of a data set you know skips that SQL completely:&lt;/P&gt;
&lt;P&gt;Data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sashelp.class (obs=0);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;If you want values, where would they come from???&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 19:59:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/485929#M31481</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-10T19:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a sas data set from data definition language.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/485930#M31482</link>
      <description>&lt;P&gt;I think you may have to use&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;proc printto log=logfile;
run;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;to direct your log output to an external file and then read the logfile with infile to get the contents in a sas dataset.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However don't take my word, there might be more straight forward methods&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 20:00:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/485930#M31482</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-08-10T20:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a sas data set from data definition language.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/485931#M31483</link>
      <description>&lt;P&gt;SAS already got that for you. All the metadata information for the tables is accessed through dictionary tables or view tables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check these tables: dictionary.tables, dictionary.columns&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select * from dictionary.columns
where libname="SASHELP" and memname="CLASS";
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Read more&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a002300184.htm" target="_self"&gt; here&amp;nbsp;&lt;/A&gt;&amp;nbsp;or google dictionary tables in SAS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 20:02:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/485931#M31483</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-08-10T20:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a sas data set from data definition language.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/485932#M31484</link>
      <description>&lt;P&gt;And Proc Contents with out= option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 20:06:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/485932#M31484</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2018-08-10T20:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a sas data set from data definition language.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/485937#M31485</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76331"&gt;@alepage&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems possible to generate the DDL from a SAS table as follow:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;describe&lt;/FONT&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sashelp.class;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Then we go in the log file and we get this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;create table SASHELP.CLASS( label='Student Data' bufsize=65536 )&lt;/P&gt;
&lt;P&gt;(&lt;/P&gt;
&lt;P&gt;Name char(8),&lt;/P&gt;
&lt;P&gt;Sex char(1),&lt;/P&gt;
&lt;P&gt;Age num,&lt;/P&gt;
&lt;P&gt;Height num,&lt;/P&gt;
&lt;P&gt;Weight num&lt;/P&gt;
&lt;P&gt;);&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can I import the DDL into&amp;nbsp; SAS to generate the data set and if so, how can we do that?&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;Use LIKE&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Proc sql;
Create table want &lt;FONT size="5" color="#800080"&gt;&lt;STRONG&gt;like&lt;/STRONG&gt;&lt;/FONT&gt; SAShelp.class;
Quit;&lt;/PRE&gt;
&lt;P&gt;Then check the table called WANT.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 20:17:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/485937#M31485</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-10T20:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a sas data set from data definition language.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/485994#M31487</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76331"&gt;@alepage&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;If your new target table structure is a SAS table and if this is about creating the table and not storing away the DDL for later use then besides of the SQL like simple code as below will do the job as well.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  if 0 set sashelp.class;
  /** below any statements you wish */  
run;

/*To create an empty table structure without any rows*/
data want;
  stop;
  set sashelp.class;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Aug 2018 01:32:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/485994#M31487</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-08-13T01:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a sas data set from data definition language.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/486131#M31488</link>
      <description>&lt;P&gt;To get the SQL, you best shot is the PRINTTO as mentioned by @&lt;SPAN class="UserName lia-user-name lia-user-rank-Super-User"&gt;&lt;A id="link_17" class="lia-link-navigation lia-page-link lia-user-name-link" style="color: #009999;" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205" target="_self"&gt;&lt;SPAN class="login-bold"&gt;novinosrin&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;.&lt;/P&gt;
&lt;P&gt;Then you must yourself wrap into a PROC SQL to execute it.&lt;/P&gt;
&lt;P&gt;But the DESCRIBE TABLE doesn't unfortunately give you the complete and correct metadata for your tables. Examples are:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;NUM doesn't carry length (see this ballot entry &lt;A href="https://communities.sas.com/t5/SASware-Ballot-Ideas/SQL-Let-DESCRIBE-generate-the-actual-length-of-NUM-columns/idi-p/220516" target="_blank"&gt;https://communities.sas.com/t5/SASware-Ballot-Ideas/SQL-Let-DESCRIBE-generate-the-actual-length-of-NUM-columns/idi-p/220516&lt;/A&gt;)&lt;/LI&gt;
&lt;LI&gt;PK is referred to as unique index (which is similar, but not the same)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;This is kinda standard functionality in other DBMS so wouldn't be expected that SAS could implement DDL generation for it's own engines...? Perhaps another Ballot item for this...&lt;/P&gt;</description>
      <pubDate>Sun, 12 Aug 2018 08:17:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/486131#M31488</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-08-12T08:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a sas data set from data definition language.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/486342#M31498</link>
      <description>&lt;P&gt;Thanks to all of you.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Based on the answers I have received, I believe that my question was not clear.&lt;/P&gt;&lt;P&gt;I have noticed that from a SAS data set it is possible to generate the DDL code using proc SQL; Describe table TableName quit; as below&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then we go in the log file and we get this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;create table SASHELP.CLASS( label='Student Data' bufsize=65536 )&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;Name char(8),&lt;/P&gt;&lt;P&gt;Sex char(1),&lt;/P&gt;&lt;P&gt;Age num,&lt;/P&gt;&lt;P&gt;Height num,&lt;/P&gt;&lt;P&gt;Weight num&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now imagine that a DDL has been generated with another software and that I have a code like the one below saved in a text file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;create table TableName&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;var 1 char(10),&lt;/P&gt;&lt;P&gt;var2 char(15),&lt;/P&gt;&lt;P&gt;var3 num,&lt;/P&gt;&lt;P&gt;var4 num,&lt;/P&gt;&lt;P&gt;var5 num&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can easly generate a SAS data Set using the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc sql:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;var 1 char(10),&lt;/P&gt;&lt;P&gt;var2 char(15),&lt;/P&gt;&lt;P&gt;var3 num,&lt;/P&gt;&lt;P&gt;var4 num,&lt;/P&gt;&lt;P&gt;var5 num&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;Quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My objective is to get the SAS data set without having to write PROC SQL; paste the content of the text file, then add quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now, I would like to know if it would be possible to generate a SAS table by calling or loading the text file which contains a DDL.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Aug 2018 13:02:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/486342#M31498</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2018-08-13T13:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a sas data set from data definition language.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/486348#M31500</link>
      <description>&lt;P&gt;If your DDL is compatible with PROC SQL syntax then you might be able to do what you want using using %INCLUDE.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql ;
%include 'my_ddl.sas' / source2;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However that is a big IF as many DDL files from other databases will use data types and options that are not compatible with SAS.&lt;/P&gt;
&lt;P&gt;You might have better success for SAS if you just create data step code to define your datasets..&lt;/P&gt;</description>
      <pubDate>Mon, 13 Aug 2018 13:54:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/486348#M31500</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-08-13T13:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a sas data set from data definition language.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/486384#M31501</link>
      <description>&lt;P&gt;hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is very simple and it works&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Aug 2018 15:21:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-sas-data-set-from-data-definition-language/m-p/486384#M31501</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2018-08-13T15:21:25Z</dc:date>
    </item>
  </channel>
</rss>

