<?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: Apply any procedure to all the files in a library in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Apply-any-procedure-to-all-the-files-in-a-library/m-p/241101#M55669</link>
    <description>Try one of the other CAT functions. &lt;BR /&gt;There's CATT, CATX, CAT. Most likely CATT, which only trims trailing spaces so you can add a space before the NMISS.</description>
    <pubDate>Tue, 29 Dec 2015 03:26:09 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-12-29T03:26:09Z</dc:date>
    <item>
      <title>Apply any procedure to all the files in a library</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Apply-any-procedure-to-all-the-files-in-a-library/m-p/241092#M55666</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have around 20 files in a library. I want to apply Proc means to all the files in the library using a macro than writing all 20 file names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It should take all the file names automatically if I specify the library name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&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, 29 Dec 2015 01:56:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Apply-any-procedure-to-all-the-files-in-a-library/m-p/241092#M55666</guid>
      <dc:creator>sundeep15685</dc:creator>
      <dc:date>2015-12-29T01:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Apply any procedure to all the files in a library</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Apply-any-procedure-to-all-the-files-in-a-library/m-p/241096#M55667</link>
      <description>&lt;P&gt;You can get all the dataset names in a library from sashelp.vtable and call execute should be straightforward. You also don't necessarily need a macro depending on your needs. Here's a demo - untested.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let lname=WORK; 

data dnames; 
set sashelp.vtable;
 where libname=upper("&amp;amp;lname"); 
run; 

data _null_; 
set dnames; 
str=cats("proc means data=&amp;amp;lname..", memname, "; run;"); 
call execute(str); 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2015 02:16:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Apply-any-procedure-to-all-the-files-in-a-library/m-p/241096#M55667</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-29T02:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Apply any procedure to all the files in a library</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Apply-any-procedure-to-all-the-files-in-a-library/m-p/241100#M55668</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code is working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was actually looking to know about missing values in each dataset using proc means, NMISS option.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As cats function is removing the trailing and leading blanks I am unable to give the NMISS option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please look into it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data _Null_;&lt;BR /&gt;set metfile;&lt;BR /&gt;str=cats("proc means data=&amp;amp;library..", memname, "nmiss", "; run;");&lt;BR /&gt;call execute(str);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is generating the statements&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc means data=TASK3.DEMOSSUBMITnmiss; run;&lt;BR /&gt;ERROR: File TASK3.DEMOSSUBMITNMISS.DATA does not exist.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where Nmiss is mixing up with the dataset name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2015 03:18:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Apply-any-procedure-to-all-the-files-in-a-library/m-p/241100#M55668</guid>
      <dc:creator>sundeep15685</dc:creator>
      <dc:date>2015-12-29T03:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Apply any procedure to all the files in a library</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Apply-any-procedure-to-all-the-files-in-a-library/m-p/241101#M55669</link>
      <description>Try one of the other CAT functions. &lt;BR /&gt;There's CATT, CATX, CAT. Most likely CATT, which only trims trailing spaces so you can add a space before the NMISS.</description>
      <pubDate>Tue, 29 Dec 2015 03:26:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Apply-any-procedure-to-all-the-files-in-a-library/m-p/241101#M55669</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-29T03:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: Apply any procedure to all the files in a library</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Apply-any-procedure-to-all-the-files-in-a-library/m-p/241102#M55670</link>
      <description>&lt;P&gt;cool. Its Working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2015 03:32:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Apply-any-procedure-to-all-the-files-in-a-library/m-p/241102#M55670</guid>
      <dc:creator>sundeep15685</dc:creator>
      <dc:date>2015-12-29T03:32:23Z</dc:date>
    </item>
  </channel>
</rss>

