<?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: Create Macro List in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-Macro-List/m-p/177507#M33952</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sir, I am confuse, &lt;/P&gt;&lt;P&gt;why use upcase to "Y" , its user given in " &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;where RPTB&amp;nbsp; EQ UPCASE('Y'); "&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;shoudnt it be like : &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;where upcase(RPTB)&amp;nbsp; EQ "Y" ;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;apology in advance for my confusion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Oct 2014 10:43:23 GMT</pubDate>
    <dc:creator>Aman4SAS</dc:creator>
    <dc:date>2014-10-10T10:43:23Z</dc:date>
    <item>
      <title>Create Macro List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Macro-List/m-p/177502#M33947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Given the data set "LKUP" as shown below, how one can create a Macro list with following business logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If rptA = Y then&amp;nbsp; generate a string of all car where rptA=Y&amp;nbsp; (e.g. &lt;SPAN style="font-size: 13.6000003814697px;"&gt;%LET LIST_RPT_A=%NRBQUOTE([Ford].[GM].[Toyota]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If rptB = Y then &lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 13.6000003814697px;"&gt;generate a string of all car where rptB=Y (e.g.&lt;/SPAN&gt; &lt;SPAN style="font-size: 13.6000003814697px;"&gt;%LET LIST_RPT_B=%NRBQUOTE([Ford].[BMW]);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data LKUP ;&lt;/P&gt;&lt;P&gt;infile cards missover; &lt;/P&gt;&lt;P&gt;input Car $ rptA $ rptB $;&lt;/P&gt;&lt;P&gt;Cards;&lt;/P&gt;&lt;P&gt;Ford Y Y&lt;/P&gt;&lt;P&gt;GM&amp;nbsp; Y&amp;nbsp; &lt;/P&gt;&lt;P&gt;Toyota&amp;nbsp;&amp;nbsp; Y &lt;/P&gt;&lt;P&gt;BMW&amp;nbsp; &lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt; Y&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;Hard coded......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA B;&lt;/P&gt;&lt;P&gt;Set LKUP;&lt;/P&gt;&lt;P&gt; IF RPTA&amp;nbsp; EQ UPCASE('Y')&amp;nbsp; THEN&amp;nbsp; DO;&lt;/P&gt;&lt;P&gt;%LET LIST_RPT_A=%NRBQUOTE([Ford].[GM].[Toyota]);&lt;/P&gt;&lt;P&gt; END;&lt;/P&gt;&lt;P&gt;IF RPTB EQ UPCASE('Y') THEN DO;&lt;/P&gt;&lt;P&gt;%LET LIST_RPT_B=%NRBQUOTE([Ford].[BMW]);&lt;/P&gt;&lt;P&gt;End;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2014 23:38:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Macro-List/m-p/177502#M33947</guid>
      <dc:creator>GPatel</dc:creator>
      <dc:date>2014-10-08T23:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Create Macro List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Macro-List/m-p/177503#M33948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select car into :LIST_RPT_A separated by ' '&lt;/P&gt;&lt;P&gt;from lkup where RPTA&amp;nbsp; EQ UPCASE('Y');&lt;/P&gt;&lt;P&gt;select car into :LIST_RPT_B separated by ' '&lt;/P&gt;&lt;P&gt;from lkup where RPTB&amp;nbsp; EQ UPCASE('Y');&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put &amp;amp;LIST_RPT_A;&lt;/P&gt;&lt;P&gt;%put &amp;amp;LIST_RPT_B;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 00:29:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Macro-List/m-p/177503#M33948</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-10-09T00:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Create Macro List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Macro-List/m-p/177504#M33949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;Thanks for your answer, but it doesn't create desired string. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt; String should look like :&amp;nbsp; " ([Ford].[GM].[Toyota]) "&amp;nbsp; or&amp;nbsp; " &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;([Ford].[BMW]) "&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 00:39:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Macro-List/m-p/177504#M33949</guid>
      <dc:creator>GPatel</dc:creator>
      <dc:date>2014-10-09T00:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create Macro List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Macro-List/m-p/177505#M33950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's easy to fix:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select catt('[',car,']') into :LIST_RPT_A separated by ' '&lt;/P&gt;&lt;P&gt;from lkup where RPTA&amp;nbsp; EQ UPCASE('Y');&lt;/P&gt;&lt;P&gt;select catt('[',car,']') into :LIST_RPT_B separated by ' '&lt;/P&gt;&lt;P&gt;from lkup where RPTB&amp;nbsp; EQ UPCASE('Y');&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 01:11:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Macro-List/m-p/177505#M33950</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-10-09T01:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create Macro List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Macro-List/m-p/177506#M33951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mr. Arthur for your prompt answer.&amp;nbsp; I made it to work. Appreciate your time and interest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards....Girish Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2014 10:22:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Macro-List/m-p/177506#M33951</guid>
      <dc:creator>GPatel</dc:creator>
      <dc:date>2014-10-10T10:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: Create Macro List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Macro-List/m-p/177507#M33952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sir, I am confuse, &lt;/P&gt;&lt;P&gt;why use upcase to "Y" , its user given in " &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;where RPTB&amp;nbsp; EQ UPCASE('Y'); "&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;shoudnt it be like : &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;where upcase(RPTB)&amp;nbsp; EQ "Y" ;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;apology in advance for my confusion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2014 10:43:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Macro-List/m-p/177507#M33952</guid>
      <dc:creator>Aman4SAS</dc:creator>
      <dc:date>2014-10-10T10:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create Macro List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Macro-List/m-p/177508#M33953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using data step:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data have ;&lt;BR /&gt;infile cards missover; &lt;BR /&gt;input Car $ rptA $ rptB $;&lt;BR /&gt;Cards;&lt;BR /&gt;Ford Y .&lt;BR /&gt;GM Y Y&amp;nbsp; &lt;BR /&gt;Toyota Y . &lt;BR /&gt;BMW&amp;nbsp; . Y&lt;BR /&gt;;&lt;BR /&gt;Run; &lt;/P&gt;&lt;P&gt;%let LIST_RPT_A=;&lt;BR /&gt;%let LIST_RPT_B=;&lt;BR /&gt; &lt;BR /&gt;data _null_;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;IF RPTA EQ UPCASE('Y')&amp;nbsp; THEN &lt;BR /&gt; do;&lt;BR /&gt;&amp;nbsp; if symget("LIST_RPT_A")="" then call symputx("LIST_RPT_A", cats("[",Car,"]"));&lt;BR /&gt;&amp;nbsp; else call symputx("LIST_RPT_A", cats(symget("LIST_RPT_A"),".[",Car,"]"));&lt;BR /&gt; end;&lt;/P&gt;&lt;P&gt;IF RPTB EQ UPCASE('Y')&amp;nbsp; THEN &lt;BR /&gt;do;&lt;BR /&gt; if symget("LIST_RPT_B")="" then call symputx("LIST_RPT_B", cats("[",Car,"]"));&lt;BR /&gt; else call symputx("LIST_RPT_B", cats(symget("LIST_RPT_B"),".[",Car,"]"));&lt;BR /&gt;end;&lt;BR /&gt;Run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2014 11:08:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Macro-List/m-p/177508#M33953</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2014-10-10T11:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Create Macro List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Macro-List/m-p/177509#M33954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="812117" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;: The only thing I added to the code suggested by stat@sas was the catt function putting brackets before and after the variable name.. Yes, the upcase('Y') is unnecessary and would have been more effective if it had been:&lt;/P&gt;&lt;P&gt;upcase(RPTB) eq 'Y'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2014 12:48:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Macro-List/m-p/177509#M33954</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-10-10T12:48:05Z</dc:date>
    </item>
  </channel>
</rss>

