<?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: proc Sql generating tables in a new WC000001 library/schema in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-Sql-generating-tables-in-a-new-WC000001-library-schema/m-p/555062#M74695</link>
    <description>&lt;P&gt;When you use quotation marks around a data set name, SAS thinks you are specifying a physical name (path name). If you omit the full path and just use the data set name, then SAS thinks you want to store the file wherever SAS is running. That location depends on the SAS interface and your deployment. Take a look at the SAS Companion book for your OS. For example: the &lt;A href="http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=hostunx&amp;amp;docsetTarget=n1dl9avdv8oakin1s0j7fzd7n05f.htm" target="_self"&gt;UNIX topic about path names&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could specify Work.&lt;EM&gt;tablename&lt;/EM&gt; if you want to be sure a table is stored in Work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;A href="http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=titlepage.htm" target="_self"&gt;Macro Language: Reference&lt;/A&gt; contains information about quoting.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Apr 2019 14:33:11 GMT</pubDate>
    <dc:creator>maggiem_sas</dc:creator>
    <dc:date>2019-04-30T14:33:11Z</dc:date>
    <item>
      <title>proc Sql generating tables in a new WC000001 library/schema</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-Sql-generating-tables-in-a-new-WC000001-library-schema/m-p/555048#M74693</link>
      <description>&lt;P&gt;This community has usually helped me by searching through past posts but I now have a question for which I cannot find any posts.&lt;/P&gt;&lt;P&gt;I am working in BASE SAS with version SAS 9.4M5.&lt;/P&gt;&lt;P&gt;This problem started with a more complex proc sql but I have refined it down to the minimum necessary to demonstrate the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running a proc sql command to create a table and instead of posting the table in the WORK library as normal default, SAS created a new library called WC000001 and posted the results there.&amp;nbsp; However, none of the logs let me know that was happening.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a simple sample that demonstrates the issue using the SASHELP library as you probably have this available:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table "results_some_stuff" as&lt;BR /&gt;(select * from sashelp.class where sex = 'M' );&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The resulting log looks like this:&lt;/P&gt;&lt;P&gt;NOTE: This SAS session is using a registry in WORK. All changes will be lost at the end of this&lt;BR /&gt;session.&lt;BR /&gt;10 proc sql;&lt;BR /&gt;11 create table "results_some_stuff" as&lt;BR /&gt;12 (select * from sashelp.class where sex = 'M' );&lt;BR /&gt;NOTE: Table results_some_stuff created, with 10 rows and 5 columns.&lt;/P&gt;&lt;P&gt;13 quit;&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NOTE: This SAS session is using a registry in WORK. All changes will be lost at the end of this&lt;BR /&gt;session.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However when I look for the dataset/table&amp;nbsp; work.results_some_stuff&amp;nbsp; it doesn't exist in my WORK library but is instead found in a new library WC000001.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have determined that what is causing this seems to be the enclosing double quotes on the table name.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I take the double quotes off, the table does get created in the WORK library.&lt;/P&gt;&lt;P&gt;14 proc sql;&lt;BR /&gt;15 create table results_some_stuff as&lt;BR /&gt;16 (select * from sashelp.class where sex = 'M' );&lt;BR /&gt;NOTE: Table WORK.RESULTS_SOME_STUFF created, with 10 rows and 5 columns.&lt;/P&gt;&lt;P&gt;17 quit;&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason I put double quotes around the table name was that I wanted to make sure that the macro variables I was using in my original example were correctly resolved.&amp;nbsp; And I was not aware of this side effect I did not expect the result I got.&lt;/P&gt;&lt;P&gt;There are no notes or warnings complaining about the double quotes so I am wondering, is there some documentation on this behavior?&amp;nbsp; Is it to be expected or is it some kind of defect?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do note that the double quoted name shows the file name as results_some_stuff but the non-quoted version states the name as WORK.RESULTS_SOME_STUFF.&amp;nbsp; &amp;nbsp; I always thought that if you don't prefix with a library name, the default is to create the table in WORK which is considered a temporary location.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advice is appeciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Carl Richardson&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>Tue, 30 Apr 2019 14:07:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-Sql-generating-tables-in-a-new-WC000001-library-schema/m-p/555048#M74693</guid>
      <dc:creator>qaguy1982</dc:creator>
      <dc:date>2019-04-30T14:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: proc Sql generating tables in a new WC000001 library/schema</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-Sql-generating-tables-in-a-new-WC000001-library-schema/m-p/555057#M74694</link>
      <description>&lt;P&gt;Interesting.&lt;/P&gt;
&lt;P&gt;I am one of those SAS users that actually use the USER library for single level names.&lt;/P&gt;
&lt;P&gt;When I run&lt;/P&gt;
&lt;PRE&gt;proc sql;
create table "results_some_stuff" as
(select * from sashelp.class where sex = 'M' );
quit;&lt;/PRE&gt;
&lt;P&gt;instead of going to the USER library the set is created in the WORK library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unless you are using name literals such as "Not normal set name"n for data sets or libraries you should not use quotes around library or data set names even if they contain macro variables.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 14:22:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-Sql-generating-tables-in-a-new-WC000001-library-schema/m-p/555057#M74694</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-04-30T14:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: proc Sql generating tables in a new WC000001 library/schema</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-Sql-generating-tables-in-a-new-WC000001-library-schema/m-p/555062#M74695</link>
      <description>&lt;P&gt;When you use quotation marks around a data set name, SAS thinks you are specifying a physical name (path name). If you omit the full path and just use the data set name, then SAS thinks you want to store the file wherever SAS is running. That location depends on the SAS interface and your deployment. Take a look at the SAS Companion book for your OS. For example: the &lt;A href="http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=hostunx&amp;amp;docsetTarget=n1dl9avdv8oakin1s0j7fzd7n05f.htm" target="_self"&gt;UNIX topic about path names&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could specify Work.&lt;EM&gt;tablename&lt;/EM&gt; if you want to be sure a table is stored in Work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;A href="http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=titlepage.htm" target="_self"&gt;Macro Language: Reference&lt;/A&gt; contains information about quoting.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 14:33:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-Sql-generating-tables-in-a-new-WC000001-library-schema/m-p/555062#M74695</guid>
      <dc:creator>maggiem_sas</dc:creator>
      <dc:date>2019-04-30T14:33:11Z</dc:date>
    </item>
  </channel>
</rss>

