<?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: List of data sets in a library in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/List-of-data-sets-in-a-library/m-p/939834#M368973</link>
    <description>&lt;P&gt;Is it equivalent to write&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let memlist=_null_;&lt;/P&gt;
&lt;P&gt;before the proc sql?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let memlist=_null_;
proc sql noprint ;
select catx('.',libname,memname)
    into :memlist separated by ' '
from dictionary.members 
where libname='R_R'
      and (memname like 'ALERTSNEG_%')
  ;
quit;
%put &amp;amp;memlist;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Aug 2024 09:02:56 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2024-08-19T09:02:56Z</dc:date>
    <item>
      <title>List of data sets in a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/List-of-data-sets-in-a-library/m-p/939827#M368970</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;Lets say that I&amp;nbsp; want to find all data sets in library R_R that start with name "ALERTSNEG_"&lt;/P&gt;
&lt;P&gt;For example:&amp;nbsp;ALERTSNEG_202401 ,&amp;nbsp;ALERTSNEG_202402,&amp;nbsp;ALERTSNEG_202403 and so on&lt;/P&gt;
&lt;P&gt;Lets say that I want to create a macro var that concatenated these data sets names.&lt;/P&gt;
&lt;P&gt;My question:&lt;/P&gt;
&lt;P&gt;what is the target of writing the code :&amp;nbsp;&lt;CODE class=" language-sas"&gt;%let memlist=_null_; &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;The&amp;nbsp;code&amp;nbsp;can&amp;nbsp;also&amp;nbsp;run&amp;nbsp;without&amp;nbsp;it.&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;Can&amp;nbsp;anyone&amp;nbsp;explain&amp;nbsp;what&amp;nbsp;is&amp;nbsp;the&amp;nbsp;benefit&amp;nbsp;of&amp;nbsp;this&amp;nbsp;code?&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&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;proc sql noprint ;
%let memlist=_null_;
select catx('.',libname,memname)
    into :memlist separated by ' '
from dictionary.members 
where libname='R_R'
      and (memname like 'ALERTSNEG_%')
  ;
quit;
%put &amp;amp;memlist;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Aug 2024 07:56:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/List-of-data-sets-in-a-library/m-p/939827#M368970</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2024-08-19T07:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: List of data sets in a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/List-of-data-sets-in-a-library/m-p/939828#M368971</link>
      <description>&lt;P&gt;Probably just to ensure that memlist does not contain anything from the previous run of the code. It works perfectly fine without it though.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2024 08:18:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/List-of-data-sets-in-a-library/m-p/939828#M368971</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2024-08-19T08:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: List of data sets in a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/List-of-data-sets-in-a-library/m-p/939829#M368972</link>
      <description>&lt;P&gt;If there's no dataset satisfying the WHERE requirement, PROC SQL would not create the macro variable, causing ERRORs later on when you use it. The %LET avoids this.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2024 08:22:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/List-of-data-sets-in-a-library/m-p/939829#M368972</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-08-19T08:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: List of data sets in a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/List-of-data-sets-in-a-library/m-p/939834#M368973</link>
      <description>&lt;P&gt;Is it equivalent to write&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let memlist=_null_;&lt;/P&gt;
&lt;P&gt;before the proc sql?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let memlist=_null_;
proc sql noprint ;
select catx('.',libname,memname)
    into :memlist separated by ' '
from dictionary.members 
where libname='R_R'
      and (memname like 'ALERTSNEG_%')
  ;
quit;
%put &amp;amp;memlist;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2024 09:02:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/List-of-data-sets-in-a-library/m-p/939834#M368973</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2024-08-19T09:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: List of data sets in a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/List-of-data-sets-in-a-library/m-p/939842#M368976</link>
      <description>Answer these two questions:&lt;BR /&gt;- When are macro statements executed/resolved?&lt;BR /&gt;- When does the SQL procedure execute statements, interactively when encountered, or all at once when QUIT; is parsed?</description>
      <pubDate>Mon, 19 Aug 2024 09:32:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/List-of-data-sets-in-a-library/m-p/939842#M368976</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-08-19T09:32:32Z</dc:date>
    </item>
  </channel>
</rss>

