<?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: Copy dataset structure in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Copy-dataset-structure/m-p/102619#M21446</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Antonio,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a side note, if you are planning doing the same on datasets other than SAS tables, such as Oracle, sybase, SQL server etc, you may need to use the following standard SQL syntax:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;CREATE&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;TABLE&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; want &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;AS&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; have&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;WHERE&lt;/SPAN&gt; &lt;SPAN style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and wrap it up using SAS pass-through. where condition can be anything not TRUE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note: proc sql options such as inobs=, outobs= may not work in this kind of situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Oct 2012 14:50:08 GMT</pubDate>
    <dc:creator>Haikuo</dc:creator>
    <dc:date>2012-10-22T14:50:08Z</dc:date>
    <item>
      <title>Copy dataset structure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-dataset-structure/m-p/102616#M21443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do there is a single way to copy only dataset structure?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I mean, I have a dataset with C columns and R rows, a would have a second dataset with the same C columns but with 0 rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 14:08:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-dataset-structure/m-p/102616#M21443</guid>
      <dc:creator>garag</dc:creator>
      <dc:date>2012-10-22T14:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Copy dataset structure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-dataset-structure/m-p/102617#M21444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then copy 0 rows over:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set&amp;nbsp;&amp;nbsp; have (obs=0);&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;BR /&gt; or&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;stop;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 14:15:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-dataset-structure/m-p/102617#M21444</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-10-22T14:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Copy dataset structure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-dataset-structure/m-p/102618#M21445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi Haikuo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both works correctly, the first one is a littel bit faster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your reply.&lt;/P&gt;&lt;P&gt;Antonio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 14:37:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-dataset-structure/m-p/102618#M21445</guid>
      <dc:creator>garag</dc:creator>
      <dc:date>2012-10-22T14:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: Copy dataset structure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-dataset-structure/m-p/102619#M21446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Antonio,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a side note, if you are planning doing the same on datasets other than SAS tables, such as Oracle, sybase, SQL server etc, you may need to use the following standard SQL syntax:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;CREATE&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;TABLE&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; want &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;AS&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; have&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;WHERE&lt;/SPAN&gt; &lt;SPAN style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and wrap it up using SAS pass-through. where condition can be anything not TRUE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note: proc sql options such as inobs=, outobs= may not work in this kind of situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 14:50:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-dataset-structure/m-p/102619#M21446</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-10-22T14:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Copy dataset structure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-dataset-structure/m-p/102620#M21447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know how standard it is, but SAS SQL offers the command :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE TABLE want LIKE have;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to create an empty table with the same structure as another 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>Mon, 22 Oct 2012 15:33:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-dataset-structure/m-p/102620#M21447</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-10-22T15:33:57Z</dc:date>
    </item>
  </channel>
</rss>

