<?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: work library question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/work-library-question/m-p/242212#M44948</link>
    <description>&lt;P&gt;If you use a SAS USER library and not just a library called USER then one level names default to the USER library, not WORK. If you want to put things into work then you must explicitly use work.dataset notation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yet another reason to be extremely cautious with using the construct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data dataname;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set dataname;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just because you can doesn't mean it is a good idea. Be &lt;STRONG&gt;very&lt;/STRONG&gt; conscience of choosing that choice when using it.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jan 2016 15:48:40 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-01-07T15:48:40Z</dc:date>
    <item>
      <title>work library question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/work-library-question/m-p/242195#M44943</link>
      <description>&lt;P&gt;I have several pieces of code similar to this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data rtlrsk_homeeq_frl_201505;&lt;BR /&gt;set user.rtlrsk_homeeq_frl_201505;&lt;BR /&gt;loan_id=put(input(account_id,best17.),z20.);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For ease I was using the same name from the permanent library and my work library.&amp;nbsp; These pieces of code have written to the permanent library.&amp;nbsp; The problem is I looked at several like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data rtlrsk_homeeq_frl_201505;&lt;BR /&gt;set user.rtlrsk_homeeq_frl_201505(obs=10);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So now the permanent librarys have been trashed.&amp;nbsp; Is this common, a know issue or something that anyone has seen before?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mark&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2016 14:55:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/work-library-question/m-p/242195#M44943</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2016-01-07T14:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: work library question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/work-library-question/m-p/242198#M44944</link>
      <description>&lt;P&gt;Are you saying that your work library points to the same physical location as the user library?&lt;/P&gt;
&lt;PRE&gt;%put %sysfunc(pathname(work));
%put %sysfunc(pathname(user));&lt;/PRE&gt;
&lt;P&gt;If so that sounds like either: a) your setup program have re-assigned work location, b) or somewhere in the code that has happened. Not sure why that would be the case. &amp;nbsp;Not that it helps much now, but I would always put access rights on libname statements:&lt;/P&gt;
&lt;P&gt;libname user "..." access=read;&lt;/P&gt;
&lt;P&gt;To avoid this accidental overwriting.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2016 15:13:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/work-library-question/m-p/242198#M44944</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-01-07T15:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: work library question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/work-library-question/m-p/242201#M44945</link>
      <description>The obs option restricts what's brought in to the data step, which is writing to the work library. Your work library contains a subset of the data in your user library, but your user library should be fine.</description>
      <pubDate>Thu, 07 Jan 2016 15:32:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/work-library-question/m-p/242201#M44945</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-07T15:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: work library question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/work-library-question/m-p/242206#M44946</link>
      <description>&lt;P&gt;The log shows this:&lt;/P&gt;
&lt;P&gt;22&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GOPTIONS ACCESSIBLE;&lt;BR /&gt;23&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put %sysfunc(pathname(work));&lt;BR /&gt;/sas/saswork/SAS_workBFD300003535_scsmt300a/SAS_work3ED700003535_scsmt300a&lt;BR /&gt;24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put %sysfunc(pathname(user));&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no path for user.&amp;nbsp; But I have another library (mortgage) with the same issue that shows the correct path.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just tried to duplicate the problem in a single code to paste the log and it did not happen again.&amp;nbsp; Thank you for the access=read option, that is new to me.&amp;nbsp; I will use that going forward.&amp;nbsp; I'm 99% sure it was not user error but am not sure what the issue is since I cannot duplicate.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2016 15:42:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/work-library-question/m-p/242206#M44946</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2016-01-07T15:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: work library question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/work-library-question/m-p/242209#M44947</link>
      <description>&lt;P&gt;I understand that but it did make a change to the library.&amp;nbsp; Another insane issue is that I do not have write access to these librarys, but from my perspective there are large changes, adding columns, limiting dataset to 10 rows.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2016 15:46:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/work-library-question/m-p/242209#M44947</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2016-01-07T15:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: work library question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/work-library-question/m-p/242212#M44948</link>
      <description>&lt;P&gt;If you use a SAS USER library and not just a library called USER then one level names default to the USER library, not WORK. If you want to put things into work then you must explicitly use work.dataset notation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yet another reason to be extremely cautious with using the construct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data dataname;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set dataname;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just because you can doesn't mean it is a good idea. Be &lt;STRONG&gt;very&lt;/STRONG&gt; conscience of choosing that choice when using it.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2016 15:48:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/work-library-question/m-p/242212#M44948</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-01-07T15:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: work library question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/work-library-question/m-p/242214#M44949</link>
      <description>&lt;P&gt;There is a global option, USER=, which controls where single-level SAS data set names get stored.&amp;nbsp; The default value for this option is USER=WORK, which is why single-level data set names get stored in the WORK library.&amp;nbsp; One use of this option is to automatically save single-level data set names.&amp;nbsp; If you were to code the option as USER=MYLIB, single-level data set names would be scored within MYLIB.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Evidently, USER as a LIBNAME is another way of overriding where single-level SAS data set names get stored.&amp;nbsp; Avoid USER, avoid WORK as libnames, and this problem should vanish.&amp;nbsp; You can probably confirm this by looking within USER, and noticing many additional SAS data set names that you didn't expect to find there.&amp;nbsp; Probably every single-level SAS data set name mentioned within your program will magically appear in that library.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2016 15:49:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/work-library-question/m-p/242214#M44949</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-01-07T15:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: work library question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/work-library-question/m-p/242215#M44950</link>
      <description>&lt;P&gt;I'm looking at my ftp site to see what is in that library.&amp;nbsp; Here's another piece of code I used:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data match_user nomatch_user match_usereq nomatch_usereq match_frl nomatch_frl;&lt;BR /&gt;merge Consolidated_Loan_Sale_Data(in=a)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtlrsk_mortgage_201506(in=b)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtlrsk_homeeq_201506(in=c)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; rtlrsk_homeeq_frl_201505(in=d);&lt;BR /&gt;by loan_id;&lt;BR /&gt;if a and b then output match_user;&lt;BR /&gt;if a and not b then output nomatch_user;&lt;BR /&gt;if a and c then output match_usereq;&lt;BR /&gt;if a and not c then output nomatch_usereq;&lt;BR /&gt;if a and d then output match_frl;&lt;BR /&gt;if a and not d then output nomatch_frl;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All of the outputs that should be in my work library are in the 'user' library.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2016 15:50:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/work-library-question/m-p/242215#M44950</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2016-01-07T15:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: work library question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/work-library-question/m-p/242219#M44951</link>
      <description>&lt;P&gt;That makes sense.&amp;nbsp; Learned a lot in this thread.&amp;nbsp; Thank you everyone.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2016 15:59:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/work-library-question/m-p/242219#M44951</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2016-01-07T15:59:34Z</dc:date>
    </item>
  </channel>
</rss>

