<?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: Learning MACROS...would like sample coding as reference in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Learning-MACROS-would-like-sample-coding-as-reference/m-p/72691#M15657</link>
    <description>Just as Arthur.Carpenter 's code.But I used call execute() which is interface of macro facility with dataset.If you like.&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
libname mylib 'c:\temp';&lt;BR /&gt;
data _null_;&lt;BR /&gt;
 set sashelp.vtable(where=(libname='MYLIB'));&lt;BR /&gt;
 call execute('proc print data=mylib.'||strip(memname)||';');&lt;BR /&gt;
 call execute('run;');&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
    <pubDate>Tue, 07 Jun 2011 07:11:39 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2011-06-07T07:11:39Z</dc:date>
    <item>
      <title>Learning MACROS...would like sample coding as reference</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Learning-MACROS-would-like-sample-coding-as-reference/m-p/72688#M15654</link>
      <description>suppose I have 5-6 different SAS data sets stored in my C: drive (example c:/SASData)&lt;BR /&gt;
&lt;BR /&gt;
What would be an effective macro that I could use that would display (using proc print) all of the data sets in that C: folder?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks for the help!</description>
      <pubDate>Sun, 05 Jun 2011 04:40:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Learning-MACROS-would-like-sample-coding-as-reference/m-p/72688#M15654</guid>
      <dc:creator>KyleS83</dc:creator>
      <dc:date>2011-06-05T04:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Learning MACROS...would like sample coding as reference</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Learning-MACROS-would-like-sample-coding-as-reference/m-p/72689#M15655</link>
      <description>here is a possible solution:&lt;BR /&gt;
[pre]%macro printit(dsn=);&lt;BR /&gt;
title1 Printing &amp;amp;dsn;&lt;BR /&gt;
proc print data=&amp;amp;dsn(obs=5);&lt;BR /&gt;
run;&lt;BR /&gt;
%mend printit;&lt;BR /&gt;
&lt;BR /&gt;
%macro getdatalist(lib=);&lt;BR /&gt;
%local count i;&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
select distinct memname&lt;BR /&gt;
   into :mem1 - :mem&amp;amp;sysmaxlong&lt;BR /&gt;
      from dictionary.members&lt;BR /&gt;
         where libname=upcase("&amp;amp;lib");&lt;BR /&gt;
quit;&lt;BR /&gt;
%let count = &amp;amp;sqlobs;&lt;BR /&gt;
%do i = 1 %to &amp;amp;count;&lt;BR /&gt;
 %printit(dsn=&amp;amp;lib..&amp;amp;&amp;amp;mem&amp;amp;i);&lt;BR /&gt;
%end;&lt;BR /&gt;
%mend getdatalist;&lt;BR /&gt;
%getdatalist(lib=sasclass)&lt;BR /&gt;
[/pre]</description>
      <pubDate>Sun, 05 Jun 2011 05:10:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Learning-MACROS-would-like-sample-coding-as-reference/m-p/72689#M15655</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2011-06-05T05:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Learning MACROS...would like sample coding as reference</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Learning-MACROS-would-like-sample-coding-as-reference/m-p/72690#M15656</link>
      <description>/* first assign your folder to a libname */&lt;BR /&gt;
libname newLib 'c:/SASData';&lt;BR /&gt;
&lt;BR /&gt;
/* to just show dataset names in ouput window */&lt;BR /&gt;
proc sql;&lt;BR /&gt;
 select memname&lt;BR /&gt;
  from &lt;BR /&gt;
	dictionary.members&lt;BR /&gt;
  where libname='newLib'&lt;BR /&gt;
 ; &lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
/* or to put the dataset names into a dataset and then view with proc print */&lt;BR /&gt;
proc sql;&lt;BR /&gt;
create table newDataset as&lt;BR /&gt;
 select memname&lt;BR /&gt;
  from &lt;BR /&gt;
	dictionary.members&lt;BR /&gt;
  where libname='newLib'&lt;BR /&gt;
 ; &lt;BR /&gt;
quit;&lt;BR /&gt;
proc print data=newDataset;&lt;BR /&gt;
run;</description>
      <pubDate>Sun, 05 Jun 2011 23:11:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Learning-MACROS-would-like-sample-coding-as-reference/m-p/72690#M15656</guid>
      <dc:creator>johnP</dc:creator>
      <dc:date>2011-06-05T23:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Learning MACROS...would like sample coding as reference</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Learning-MACROS-would-like-sample-coding-as-reference/m-p/72691#M15657</link>
      <description>Just as Arthur.Carpenter 's code.But I used call execute() which is interface of macro facility with dataset.If you like.&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
libname mylib 'c:\temp';&lt;BR /&gt;
data _null_;&lt;BR /&gt;
 set sashelp.vtable(where=(libname='MYLIB'));&lt;BR /&gt;
 call execute('proc print data=mylib.'||strip(memname)||';');&lt;BR /&gt;
 call execute('run;');&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Tue, 07 Jun 2011 07:11:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Learning-MACROS-would-like-sample-coding-as-reference/m-p/72691#M15657</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-06-07T07:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Learning MACROS...would like sample coding as reference</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Learning-MACROS-would-like-sample-coding-as-reference/m-p/72692#M15658</link>
      <description>if you are only interested in the characteristics of the datasets and not the physical data then you can use &lt;BR /&gt;
&lt;BR /&gt;
proc contents data=lib._all_;&lt;BR /&gt;
run;</description>
      <pubDate>Tue, 07 Jun 2011 08:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Learning-MACROS-would-like-sample-coding-as-reference/m-p/72692#M15658</guid>
      <dc:creator>RMP</dc:creator>
      <dc:date>2011-06-07T08:27:55Z</dc:date>
    </item>
  </channel>
</rss>

