<?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 do I simplify pulling multiple datasets (from a pubic library) into my work library? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-simplify-pulling-multiple-datasets-from-a-public/m-p/665380#M198948</link>
    <description>&lt;P&gt;In addition to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;'s suggestion I would say that if your are going to want to use those data sets in another SAS session that you should copy them to permanent library instead of Work. When you close SAS then your work library is emptied (barring some interesting settings) and if you need the data then you start from scratch. If you create a local permanent library then you just make sure that library is available and you're good to go.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of do you need to have new versions because the public data changes?&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jun 2020 15:05:02 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-06-26T15:05:02Z</dc:date>
    <item>
      <title>How do I simplify pulling multiple datasets (from a public library) into my work library?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-simplify-pulling-multiple-datasets-from-a-public/m-p/665376#M198944</link>
      <description>&lt;P&gt;&lt;STRONG&gt;I'm learning SAS and I'm looking for ways to make my code better.&lt;/STRONG&gt; For assignments, I start by pulling the files I need from a &lt;EM&gt;public&lt;/EM&gt; library into my&amp;nbsp;&lt;EM&gt;work&lt;/EM&gt; library.&amp;nbsp; Right now, I am writing out a DATA SET step for each file pull. For example, if I know I need to work on three files, I start my assignment with the code below:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data dataset1;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; set public.dataset1;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data dataset2;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; set public.dataset2;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data dataset3;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; set public.dataset3;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Is there a way to simplify this? And what are your thoughts on best practices, if any?&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2020 19:27:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-simplify-pulling-multiple-datasets-from-a-public/m-p/665376#M198944</guid>
      <dc:creator>jlsagisi</dc:creator>
      <dc:date>2020-06-26T19:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I simplify pulling multiple datasets (from a public library) into my work library?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-simplify-pulling-multiple-datasets-from-a-public/m-p/665378#M198946</link>
      <description>&lt;P&gt;Since you specifically ask about "best practices", one has to ask why you want to do this. You can do a PROC MEANS (for example) or any other PROC on public.dataset1, just as you could on work.dataset1. The advantage of doing it on public.dataset1 is that it is one less step to program for each data set of interest. So I am asking you to consider simplifying your work flow by leaving the data sets in library PUBLIC. In your LIBNAME PUBLIC statement, you can add option ACCESS=READONLY so that you don't accidentally overwrite the data sets in PUBLIC. These are "best practices" in my opinion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nevertheless, you may have valid reasons to do this which you didn't state, in which case &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=proc&amp;amp;docsetTarget=p04y85z9f13uaan10s1k40ptx6gs.htm&amp;amp;locale=en" target="_self"&gt;PROC COPY&lt;/A&gt; will do what you want, in bulk, all (or selected) datasets in PUBLIC get copied to WORK by writing one PROC COPY.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2020 17:00:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-simplify-pulling-multiple-datasets-from-a-public/m-p/665378#M198946</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-06-26T17:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I simplify pulling multiple datasets (from a pubic library) into my work library?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-simplify-pulling-multiple-datasets-from-a-public/m-p/665380#M198948</link>
      <description>&lt;P&gt;In addition to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;'s suggestion I would say that if your are going to want to use those data sets in another SAS session that you should copy them to permanent library instead of Work. When you close SAS then your work library is emptied (barring some interesting settings) and if you need the data then you start from scratch. If you create a local permanent library then you just make sure that library is available and you're good to go.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of do you need to have new versions because the public data changes?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2020 15:05:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-simplify-pulling-multiple-datasets-from-a-public/m-p/665380#M198948</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-26T15:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I simplify pulling multiple datasets (from a pubic library) into my work library?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-simplify-pulling-multiple-datasets-from-a-public/m-p/665381#M198949</link>
      <description>Great question. I was told to do this so I don't accidentally make changes to a "master copy" in the public folder (which is used by more than person). And, I definitely see what you're saying. I was able to use PROC COPY. Thank you.</description>
      <pubDate>Fri, 26 Jun 2020 15:12:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-simplify-pulling-multiple-datasets-from-a-public/m-p/665381#M198949</guid>
      <dc:creator>jlsagisi</dc:creator>
      <dc:date>2020-06-26T15:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I simplify pulling multiple datasets (from a pubic library) into my work library?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-simplify-pulling-multiple-datasets-from-a-public/m-p/665382#M198950</link>
      <description>&lt;P&gt;Use PROC COPY.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc copy inlib=public outlib=work;
  select dataset1 dataset2 dataset3 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Jun 2020 15:15:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-simplify-pulling-multiple-datasets-from-a-public/m-p/665382#M198950</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-06-26T15:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I simplify pulling multiple datasets (from a pubic library) into my work library?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-simplify-pulling-multiple-datasets-from-a-public/m-p/665383#M198951</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/335069"&gt;@jlsagisi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Great question. I was told to do this so I don't accidentally make changes to a "master copy" in the public folder (which is used by more than person). And, I definitely see what you're saying. I was able to use PROC COPY. Thank you.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Just make sure to define PUBLIC as readonly and you will not be able to change them.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname public 'path' access=readonly;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Jun 2020 15:19:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-simplify-pulling-multiple-datasets-from-a-public/m-p/665383#M198951</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-06-26T15:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I simplify pulling multiple datasets (from a pubic library) into my work library?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-simplify-pulling-multiple-datasets-from-a-public/m-p/665401#M198965</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/335069"&gt;@jlsagisi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Great question. I was told to do this so I don't accidentally make changes to a "master copy" in the public folder (which is used by more than person). And, I definitely see what you're saying. I was able to use PROC COPY. Thank you.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Depending on where your Public library is defined permissions or options should prevent that.&lt;/P&gt;
&lt;P&gt;If you execute a LIBNAME statement you can add the option Access=readonly and then you cannot modify any of the data sets, intentionally or accidentally.&lt;/P&gt;
&lt;P&gt;The statement would look something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;libname mylib "&amp;lt;path to the library&amp;gt;" access=readonly;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2020 16:12:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-simplify-pulling-multiple-datasets-from-a-public/m-p/665401#M198965</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-26T16:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I simplify pulling multiple datasets (from a public library) into my work library?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-simplify-pulling-multiple-datasets-from-a-public/m-p/665413#M198974</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/335069"&gt;@jlsagisi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Might I suggest that you go back to your ORIGINAL post and correct the spelling of "public" in the Subject line? (Or perhaps a moderator can do this). Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2020 17:01:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-simplify-pulling-multiple-datasets-from-a-public/m-p/665413#M198974</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-06-26T17:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I simplify pulling multiple datasets (from a public library) into my work library?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-simplify-pulling-multiple-datasets-from-a-public/m-p/665437#M198982</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/335069"&gt;@jlsagisi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Might I suggest that you go back to your ORIGINAL post and correct the spelling of "public" in the Subject line? (Or perhaps a moderator can do this). Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Done&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2020 19:27:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-simplify-pulling-multiple-datasets-from-a-public/m-p/665437#M198982</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-26T19:27:49Z</dc:date>
    </item>
  </channel>
</rss>

