<?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: Macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro/m-p/701145#M214682</link>
    <description>&lt;P&gt;And what is your question?&lt;/P&gt;</description>
    <pubDate>Tue, 24 Nov 2020 05:34:01 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-11-24T05:34:01Z</dc:date>
    <item>
      <title>Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro/m-p/695846#M212400</link>
      <description>&lt;P&gt;Use SASHELP.BASEBALL&lt;BR /&gt;Write a code to identify count of players in League by Division. Save the counts in a macro&lt;BR /&gt;variable to display as below in red.&lt;BR /&gt;Also derive the n(%) for every team&lt;BR /&gt;N=total number of players in National East etc.&lt;BR /&gt;n(%)= n is no. of players in team e.g St. Louis in National East) while&lt;BR /&gt;% is (n/N * 100)&lt;BR /&gt;Write a proc report to create below output as rtf file&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2020 08:14:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro/m-p/695846#M212400</guid>
      <dc:creator>Riaz97</dc:creator>
      <dc:date>2020-11-02T08:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro/m-p/695848#M212402</link>
      <description>&lt;P&gt;Please change the title to something meaningful, e.g. "Homework - Need help in writing a macro". Then post the code you have already tried.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2020 08:16:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro/m-p/695848#M212402</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-11-02T08:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro/m-p/701072#M214634</link>
      <description>&lt;P&gt;proc sort data=sashelp.baseball out=baseball;&lt;BR /&gt;by league division;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc freq data=baseball;&lt;BR /&gt;tables team/nocum out=base;&lt;BR /&gt;by league division;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table d as select league, division, sum(Count) as totalplayers from base&lt;BR /&gt;group by league, division;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;select totalplayers into :n1 - :n4 from d&lt;BR /&gt;order by league, division;&lt;BR /&gt;quit;&lt;BR /&gt;%put &amp;amp;n1 &amp;amp;n2 &amp;amp;n3 &amp;amp;n4;&lt;/P&gt;&lt;P&gt;data base1;&lt;BR /&gt;merge base d;&lt;BR /&gt;by league division;&lt;BR /&gt;count_percent=strip(put(count,best.))||"("||strip(round(percent,0.01))||")";&lt;BR /&gt;abbre=substr(league,1,1)||substr(division,1,1);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=base1;&lt;BR /&gt;by team;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc transpose data=base1 out=base2;&lt;BR /&gt;by team;&lt;BR /&gt;var count_percent;&lt;BR /&gt;id abbre;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data base3;&lt;BR /&gt;set base2;&lt;BR /&gt;if missing(NE) then NE="0(0.00)";&lt;BR /&gt;if missing(NW) then NW="0(0.00)";&lt;BR /&gt;if missing(AE) then AE="0(0.00)";&lt;BR /&gt;if missing(AW) then AW="0(0.00)";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc report data=base3 headskip headline nowd center split='*';&lt;BR /&gt;column Team gap ("National" NE NW ) ("American" AE AW );&lt;BR /&gt;define Team/ "Teams" ;&lt;BR /&gt;define gap / ' ' style={cellwidth=0.75in};&lt;BR /&gt;define NE/ "East*(N=&amp;amp;n3)";&lt;BR /&gt;define NW/ "West*(N=&amp;amp;n4)";&lt;BR /&gt;define AE/ "East*(N=&amp;amp;n1)" ;&lt;BR /&gt;define AW/ "West*(N=&amp;amp;n2)" ;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 21:23:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro/m-p/701072#M214634</guid>
      <dc:creator>Riaz97</dc:creator>
      <dc:date>2020-11-23T21:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro/m-p/701145#M214682</link>
      <description>&lt;P&gt;And what is your question?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2020 05:34:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro/m-p/701145#M214682</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-24T05:34:01Z</dc:date>
    </item>
  </channel>
</rss>

