<?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: &amp;quot;Set&amp;quot; all datasets in a particular library in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354370#M82901</link>
    <description>&lt;P&gt;No doubt I'm going about this particular problem solving in a pretty inefficient way. &amp;nbsp;Thank goodness for tolerant computer and software.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I were to hire you for a consultation, you certainly would set me on a better path.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Included in each file is a "Mean" which I need. &amp;nbsp;That's one of the variables. &amp;nbsp;Arrived at through Proc Univariate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to find which "Means" are highest, and which are lowest, of all the files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no direct way to ask SAS: Among these 40,000 files, which have the largest "Mean"? &amp;nbsp;Which the smallest?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead I must concatenate into one dataset. &amp;nbsp;Then sort.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But, that approach is probably inefficient as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good grief.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Apr 2017 09:22:32 GMT</pubDate>
    <dc:creator>NKormanik</dc:creator>
    <dc:date>2017-04-28T09:22:32Z</dc:date>
    <item>
      <title>"Set" all datasets in a particular library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354351#M82890</link>
      <description>&lt;P&gt;Here's my code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname i_50401 "c:\0_sas_1\i_50401";

data sas_1.i_50401;
set
i_50401._all_
;
run
;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All the datasets in the library have the same variables, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Error from SAS:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: File I_50401._ALL_.DATA does not exist.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can I not use _all_ in the above way??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I thought I could avoid having to list all the files (40,000).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please advise.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Nicholas Kormanik&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 07:43:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354351#M82890</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2017-04-28T07:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: "Set" all datasets in a particular library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354357#M82894</link>
      <description>&lt;P&gt;If those datasets all begin with a certain letter, you could use (eg)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;set i_50401.x:;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Otherwise you could do 27 steps (a-z and _), and finally concatenate all 27 intermediate results into one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Keep in mind that the : wildcard for datasets was added with SAS 9.2, so it won't work with older versions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Although I have to question which logic got you to a point where you have 40.000 identicallly structured datasets.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 07:53:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354357#M82894</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-04-28T07:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: "Set" all datasets in a particular library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354358#M82895</link>
      <description>&lt;P&gt;Phew! &amp;nbsp;Appears to be working. &amp;nbsp;I forgot about that way of indicating wildcard.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just to clarify, though, in case others want to know, cannot _ALL_ be used in the case at hand??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 08:12:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354358#M82895</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2017-04-28T08:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: "Set" all datasets in a particular library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354359#M82896</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@NicholasKormanik wrote:&lt;BR /&gt;
&lt;P&gt;Phew! &amp;nbsp;Appears to be working. &amp;nbsp;I forgot about that way of indicating wildcard.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just to clarify, though, in case others want to know, cannot _ALL_ be used in the case at hand??&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;No, _all_ does not work in a set statement. Your situation is a very unusual one, to say the least. Typically you have a very finite number of datasets that need concatenating, and it is expected that those will also have a common prefix if one needs to automate that.&lt;/P&gt;
&lt;P&gt;How did you arrive at 40.000 datasets, if I masy ask?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 08:18:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354359#M82896</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-04-28T08:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: "Set" all datasets in a particular library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354370#M82901</link>
      <description>&lt;P&gt;No doubt I'm going about this particular problem solving in a pretty inefficient way. &amp;nbsp;Thank goodness for tolerant computer and software.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I were to hire you for a consultation, you certainly would set me on a better path.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Included in each file is a "Mean" which I need. &amp;nbsp;That's one of the variables. &amp;nbsp;Arrived at through Proc Univariate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to find which "Means" are highest, and which are lowest, of all the files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no direct way to ask SAS: Among these 40,000 files, which have the largest "Mean"? &amp;nbsp;Which the smallest?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead I must concatenate into one dataset. &amp;nbsp;Then sort.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But, that approach is probably inefficient as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good grief.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 09:22:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354370#M82901</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2017-04-28T09:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: "Set" all datasets in a particular library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354409#M82914</link>
      <description>&lt;P&gt;I'd look strongly if the "40.000 files" issue could not be solved by using by-group processing first. So that you have one dataset with 40.000 results, instead of the other way round.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 10:51:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354409#M82914</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-04-28T10:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: "Set" all datasets in a particular library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354421#M82922</link>
      <description>&lt;P&gt;But... if the result is the same???&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One large concatenated dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm miffed that SAS does not state exactly how many datasets it concatenated in the run -- i.e., 40,000.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Duh.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One just has to assume that SAS got 'em all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sad.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 11:22:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354421#M82922</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2017-04-28T11:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: "Set" all datasets in a particular library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354426#M82924</link>
      <description>&lt;P&gt;That's because 40.000 similar datasets in one library is such an inefficient thing that nobody at SAS would even contemplate that. For a reason.&lt;/P&gt;
&lt;P&gt;40.000 members in a directory file is something that starts to affect the performance of operating systems, even at the heavy-duty level (think z/OS, AIX or similar).&lt;/P&gt;
&lt;P&gt;And you do have information in the log:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class1 class2 class3;
set sashelp.class;
run;

data final;
set work.c:;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;produces this log:&lt;/P&gt;
&lt;PRE&gt;24         data class1 class2 class3;
25         set sashelp.class;
26         run;

NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.CLASS1 has 19 observations and 5 variables.
NOTE: The data set WORK.CLASS2 has 19 observations and 5 variables.
NOTE: The data set WORK.CLASS3 has 19 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      

27         
28         data final;
29         set work.c:;
30         run;

NOTE: There were 19 observations read from the data set WORK.CLASS1.
NOTE: There were 19 observations read from the data set WORK.CLASS2.
NOTE: There were 19 observations read from the data set WORK.CLASS3.
NOTE: The data set WORK.FINAL has 57 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
&lt;/PRE&gt;
&lt;P&gt;So you have a listing of all contributing datasets in the log. To make sure, save the log to a file, extract the "NOTE: There were ..." lines from it and compare that to a directory listing.&lt;/P&gt;
&lt;P&gt;But you should start at square one and check if using by in the proc univariate would not solve your problem in an easier way.&lt;/P&gt;
&lt;P&gt;Or at least run the procedure repeatedly in a macro (or from a dataset with call execute) and have it append the (temporary) results to a common output dataset.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 11:33:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354426#M82924</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-04-28T11:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: "Set" all datasets in a particular library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354430#M82926</link>
      <description>&lt;P&gt;SAS did not implement the use of _ALL_ for specifying a list for members.&lt;/P&gt;
&lt;P&gt;I suspect it is because it could potentially cause confusion for existing program since _ALL_ is a valid member name.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _all_;
 x=1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Of course if you did make a member with that Name it would cause trouble with PROC CONTENTS since data=libref._all_ has been a valid syntax for PROC CONTENTS for a long time.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 12:06:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354430#M82926</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-04-28T12:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: "Set" all datasets in a particular library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354501#M82937</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@NicholasKormanik wrote:&lt;BR /&gt;
&lt;P&gt;But... if the result is the same???&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One large concatenated dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm miffed that SAS does not state exactly how many datasets it concatenated in the run -- i.e., 40,000.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Duh.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One just has to assume that SAS got 'em all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sad.&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;If you are going to concatenate 40,000 data sets I'm pretty sure you will need to use OPEN=DEFER.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cl1 cl2 cl3;
   set sashelp.class;
   run;
data cl4 cl5 cl6;
   set sashelp.class;
   keep weight;
   run;
data weight;
   set cl:(keep=weight) open=defer;
   run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Apr 2017 15:06:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354501#M82937</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2017-04-28T15:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: "Set" all datasets in a particular library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354686#M83002</link>
      <description>&lt;P&gt;The log gives the number of observations, and variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But not the number of imported files. &amp;nbsp;Surprisingly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One has to examine the log after the fact, in some text edit program, to see which files may have been excluded by SAS. &amp;nbsp;Likely an exhausting process.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Apr 2017 08:01:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354686#M83002</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2017-04-29T08:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: "Set" all datasets in a particular library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354724#M83015</link>
      <description>&lt;P&gt;You can add code to count the dataset, but only those that have observations.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class1 class2 class3(where=(age=0));
set sashelp.class;
run;

data final;
  length dsn $41 ;
  if eof then put 'NOTE: ' n_nonzero :comma12. 'datasets contributed observations.';
  set work.class: indsname=dsn end=eof;
  n_nonzero + dsn^=lag(dsn);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;NOTE: 2 datasets contributed observations.
NOTE: There were 19 observations read from the data set WORK.CLASS1.
NOTE: There were 19 observations read from the data set WORK.CLASS2.
NOTE: There were 0 observations read from the data set WORK.CLASS3.
NOTE: The data set WORK.FINAL has 38 observations and 6 variables.&lt;/PRE&gt;</description>
      <pubDate>Sat, 29 Apr 2017 16:56:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354724#M83015</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-04-29T16:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: "Set" all datasets in a particular library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354791#M83040</link>
      <description>&lt;P&gt;Seems super cool. &amp;nbsp;At least potentially. &amp;nbsp;Not following exactly, though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's my simple program. &amp;nbsp;Please edit to add your suggestion:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sas_1.i_50501; 
set i_50501.i:; 
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks a zillion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Apr 2017 06:53:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-Set-quot-all-datasets-in-a-particular-library/m-p/354791#M83040</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2017-04-30T06:53:21Z</dc:date>
    </item>
  </channel>
</rss>

