<?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: SAS Macro help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-help/m-p/93200#M19653</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am still have some questions ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what are the values you assinged to the following ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;nod...........?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;subject...........?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And please try &lt;STRONG&gt;without macros for single value/excution&lt;/STRONG&gt;......and post here...some one would help you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALLU&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 30 Mar 2013 09:42:09 GMT</pubDate>
    <dc:creator>allurai0412</dc:creator>
    <dc:date>2013-03-30T09:42:09Z</dc:date>
    <item>
      <title>SAS Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-help/m-p/93199#M19652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;need your help in macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;below is my code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let a1=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let a2=2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let a3=3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let a4=4;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let a5=5;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let a6=;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let a7=;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let a8=;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let a9=;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let a10=;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; %macro export;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;%do i = 1 %to &amp;amp;nod;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let nm&amp;amp;i = &amp;amp;&amp;amp;nm&amp;amp;i;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data = db.&amp;amp;&amp;amp;nm&amp;amp;i out = &amp;amp;&amp;amp;nm&amp;amp;i;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by &amp;amp;subject;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data db1.&amp;amp;&amp;amp;nm&amp;amp;i;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set &amp;amp;&amp;amp;nm&amp;amp;i;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by &amp;amp;subject;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;where &amp;amp;subject in (&amp;amp;a1,&amp;amp;a2,&amp;amp;a3,&amp;amp;a4,&amp;amp;a5);&lt;/STRONG&gt; ***************provide subject/patient number for output data set***********************;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend export;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%export;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i want the result on the base of my macroparameters means if i fillup 5 macro para then in my where condition it should took only 5 variables and if i fill up 10 then it should take 10 values.i have highlited the part.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it possible ? kindly guide me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chirayu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Mar 2013 08:41:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-help/m-p/93199#M19652</guid>
      <dc:creator>chirayujaiswal</dc:creator>
      <dc:date>2013-03-30T08:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-help/m-p/93200#M19653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am still have some questions ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what are the values you assinged to the following ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;nod...........?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;subject...........?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And please try &lt;STRONG&gt;without macros for single value/excution&lt;/STRONG&gt;......and post here...some one would help you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALLU&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Mar 2013 09:42:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-help/m-p/93200#M19653</guid>
      <dc:creator>allurai0412</dc:creator>
      <dc:date>2013-03-30T09:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-help/m-p/93201#M19654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for replaying,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i just want to know how we can use all global macros in where condition with IN operator ? Means if i use 5 macro value then no need to update where condition,my where condition should be remain same. Is it possible ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Mar 2013 11:37:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-help/m-p/93201#M19654</guid>
      <dc:creator>chirayujaiswal</dc:creator>
      <dc:date>2013-03-30T11:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-help/m-p/93202#M19655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can reference the empty macro variables in your where condition.&amp;nbsp; For example run these simple test cases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let a1=14;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let a2=;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let subject=age ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data want ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; set sashelp.class ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; where &amp;amp;subject in (&amp;amp;a1,&amp;amp;a2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let a1='Alfred';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let a2=;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let subject=name ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data want ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; set sashelp.class ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; where &amp;amp;subject in (&amp;amp;a1,&amp;amp;a2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Mar 2013 17:33:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-help/m-p/93202#M19655</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-03-30T17:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-help/m-p/93203#M19656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe below sample covers what you're asking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let a1=1;&lt;BR /&gt;%let a2=2;&lt;BR /&gt;%let a3=3;&lt;BR /&gt;%let a4=4;&lt;BR /&gt;%let a5=5;&lt;BR /&gt;%let a6=;&lt;BR /&gt;%let a7=;&lt;BR /&gt;%let a8=8;&lt;BR /&gt;%let a9=;&lt;BR /&gt;%let a10=;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;&amp;nbsp; select value into :in_values separated by ','&lt;BR /&gt;&amp;nbsp; from dictionary.macros&lt;BR /&gt;&amp;nbsp; where scope='GLOBAL' and prxmatch('/A\d+/oi',name)=1 and not missing(value)&lt;BR /&gt;&amp;nbsp; ;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;&amp;nbsp; do i= 0 to 10;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i in (&amp;amp;in_values) then output;&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 Mar 2013 05:40:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-help/m-p/93203#M19656</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2013-03-31T05:40:04Z</dc:date>
    </item>
  </channel>
</rss>

