<?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: macros in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macros/m-p/240876#M268370</link>
    <description>&lt;P&gt;If a macro variable parameter has comma's how does SAS know which is part of the macro %scan, and which is part of the macro variable. Try using a different delimiter for your macro variable list.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 26 Dec 2015 06:02:37 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-12-26T06:02:37Z</dc:date>
    <item>
      <title>macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macros/m-p/240875#M268369</link>
      <description>&lt;P&gt;have to dipslay the datasets starting with name P&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;select distinct memname into : ab separated by ',' from&lt;BR /&gt;dictionary.columns where libname='work' and upcase(memname) like"P%";&lt;BR /&gt;%let r=&amp;amp;sqlobs;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%put &amp;amp;ab &amp;amp;r;&lt;/P&gt;&lt;P&gt;(P1,PATIENT,PAWAN,PAWAN1,PP,PULMICORT_PA,PULMICORT_PH 7)&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;&lt;P&gt;&lt;BR /&gt;%macro b(libname);&lt;BR /&gt;%do i= 1 %to &amp;amp;r;&lt;/P&gt;&lt;P&gt;proc print data=&amp;amp;libname..%scan(&amp;amp;ab,&amp;amp;i);&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;%b(work);&lt;/P&gt;&lt;P&gt;getting error &amp;nbsp;-&lt;/P&gt;&lt;P&gt;ERROR: Macro function %SCAN has too many arguments. The excess arguments will be ignored.&lt;BR /&gt;ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand&lt;BR /&gt;is required. The condition was: PATIENT&lt;BR /&gt;ERROR: Argument 2 to macro function %SCAN is not a number&lt;/P&gt;</description>
      <pubDate>Sat, 26 Dec 2015 05:07:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macros/m-p/240875#M268369</guid>
      <dc:creator>pawandh</dc:creator>
      <dc:date>2015-12-26T05:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macros/m-p/240876#M268370</link>
      <description>&lt;P&gt;If a macro variable parameter has comma's how does SAS know which is part of the macro %scan, and which is part of the macro variable. Try using a different delimiter for your macro variable list.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Dec 2015 06:02:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macros/m-p/240876#M268370</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-26T06:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macros/m-p/240964#M268371</link>
      <description>&lt;P&gt;It is a&amp;nbsp;job interview question for some CRO corporation ?&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;%macro b(libname);
data _null_;
 set sashelp.vmember(where=(libname="%upcase(&amp;amp;libname)" and upcase(memname) like "P%"));
 call execute(cats('proc print data=',libname,'.',memname,';run;'));
run;
%mend;
%b(work)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2015 01:36:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macros/m-p/240964#M268371</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-12-28T01:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macros/m-p/240967#M268372</link>
      <description>No it is not a job interview question.:)&lt;BR /&gt;here vmember is a data set name?</description>
      <pubDate>Mon, 28 Dec 2015 01:53:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macros/m-p/240967#M268372</guid>
      <dc:creator>pawandh</dc:creator>
      <dc:date>2015-12-28T01:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macros/m-p/240968#M268373</link>
      <description>it could VIEW or CATALOG , any sas member. if you only want TABLE add another option  datatype='data' .  If your libname only contain TABLE, that is not a question.</description>
      <pubDate>Mon, 28 Dec 2015 01:55:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macros/m-p/240968#M268373</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-12-28T01:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macros/m-p/240969#M268374</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro b(libname);
data _null_;
 set sashelp.vmember(where=(libname="%upcase(&amp;amp;libname)" and upcase(memname) like "P%" and memtype='DATA'));
 call execute(cats('proc print data=',libname,'.',memname,';run;'));
run;
%mend;
%b(work)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Updated&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2015 02:00:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macros/m-p/240969#M268374</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-12-28T02:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macros/m-p/240970#M268375</link>
      <description>sorry but not able to understand ...here v r copying the data from sashelp library(set sashelp) then how v can give this libname condition as already v have defined the library..Plz explain</description>
      <pubDate>Mon, 28 Dec 2015 02:23:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macros/m-p/240970#M268375</guid>
      <dc:creator>pawandh</dc:creator>
      <dc:date>2015-12-28T02:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macros/m-p/240971#M268376</link>
      <description>Sorry. It is a  VIEW . while dictionary.members is a TABLE .</description>
      <pubDate>Mon, 28 Dec 2015 02:24:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macros/m-p/240971#M268376</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-12-28T02:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: macros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macros/m-p/240972#M268377</link>
      <description>You can use this view as a table (dictionary.members) at anywhere, most likely in data step . This view can use other data set option too like  KEEP DROP .........</description>
      <pubDate>Mon, 28 Dec 2015 02:27:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macros/m-p/240972#M268377</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-12-28T02:27:31Z</dc:date>
    </item>
  </channel>
</rss>

