<?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 Macro Question in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Macro-Question/m-p/82388#M3974</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;I wrote a macro and I feel it needs to be tiday. Too many dataset names. Could anybody help me look tidy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro age(dname1=,dname2=,dname3=,dname4=,dname5=);&lt;/P&gt;&lt;P&gt;proc means data=&amp;amp;dname1 nway noprint;&lt;BR /&gt;var age;&lt;BR /&gt;output out=&amp;amp;dname2 n= mean= std= median= min= max=/autoname;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data &amp;amp;dname3;&lt;BR /&gt;set &amp;amp;dname2;&lt;BR /&gt;keep n meansd median minmax;&lt;BR /&gt;n=put(age_N,4.);&lt;BR /&gt;meansd=put(age_Mean,4.1)|| " ("||put(age_StdDev,4.1)||" )";&lt;BR /&gt;median=put(age_Median,4.1);&lt;BR /&gt;minmax=put(age_Min,4.1)&amp;nbsp; ||"/"|| put(age_Max,4.1);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc transpose data=&amp;amp;dname3 out=&amp;amp;dname4;&lt;BR /&gt;var n meansd median minmax;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data &amp;amp;dname5(drop=_name_);&lt;BR /&gt;set &amp;amp;dname4;&lt;BR /&gt;stat=put(_name_,$age.);&lt;BR /&gt;label="Age (Years)";&lt;BR /&gt;run;&lt;BR /&gt;%mend;&lt;BR /&gt;%age(dname1=one,dname2=two,dname3=three,dname4=four,dname5=five);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Oct 2012 20:44:25 GMT</pubDate>
    <dc:creator>robertrao</dc:creator>
    <dc:date>2012-10-01T20:44:25Z</dc:date>
    <item>
      <title>Macro Question</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Macro-Question/m-p/82388#M3974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;I wrote a macro and I feel it needs to be tiday. Too many dataset names. Could anybody help me look tidy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro age(dname1=,dname2=,dname3=,dname4=,dname5=);&lt;/P&gt;&lt;P&gt;proc means data=&amp;amp;dname1 nway noprint;&lt;BR /&gt;var age;&lt;BR /&gt;output out=&amp;amp;dname2 n= mean= std= median= min= max=/autoname;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data &amp;amp;dname3;&lt;BR /&gt;set &amp;amp;dname2;&lt;BR /&gt;keep n meansd median minmax;&lt;BR /&gt;n=put(age_N,4.);&lt;BR /&gt;meansd=put(age_Mean,4.1)|| " ("||put(age_StdDev,4.1)||" )";&lt;BR /&gt;median=put(age_Median,4.1);&lt;BR /&gt;minmax=put(age_Min,4.1)&amp;nbsp; ||"/"|| put(age_Max,4.1);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc transpose data=&amp;amp;dname3 out=&amp;amp;dname4;&lt;BR /&gt;var n meansd median minmax;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data &amp;amp;dname5(drop=_name_);&lt;BR /&gt;set &amp;amp;dname4;&lt;BR /&gt;stat=put(_name_,$age.);&lt;BR /&gt;label="Age (Years)";&lt;BR /&gt;run;&lt;BR /&gt;%mend;&lt;BR /&gt;%age(dname1=one,dname2=two,dname3=three,dname4=four,dname5=five);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 20:44:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Macro-Question/m-p/82388#M3974</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-10-01T20:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Question</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Macro-Question/m-p/82389#M3975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry...... i meant TIDY&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 20:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Macro-Question/m-p/82389#M3975</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-10-01T20:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Question</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Macro-Question/m-p/82390#M3976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Karun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My first question would be "Do you really need to write this as a SAS macro?"&amp;nbsp; As written, it appears to be quite specific (i.e., not reusable for future tasks) and could easily be done outside of the macro language.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, for any code (in or out of macroland), you really should make use of indentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Third, do you need all five files or can one or more of them be re-used?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Art&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 21:15:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Macro-Question/m-p/82390#M3976</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-10-01T21:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Question</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Macro-Question/m-p/82391#M3977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arthur,&lt;/P&gt;&lt;P&gt;There are 5 datasets which goes seperately into dname1(sorry for just putting only a part of my code here)&lt;/P&gt;&lt;P&gt;So I get to reuse it 5 times&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 21:24:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Macro-Question/m-p/82391#M3977</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-10-01T21:24:38Z</dc:date>
    </item>
  </channel>
</rss>

