<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: SAS Macros: Letting SAS Do the Typing</title>
	<atom:link href="http://scott.sherrillmix.com/blog/programmer/sas-macros-letting-sas-do-the-typing/feed/" rel="self" type="application/rss+xml" />
	<link>http://scott.sherrillmix.com/blog/programmer/sas-macros-letting-sas-do-the-typing/</link>
	<description>I'm a biologist not a...</description>
	<lastBuildDate>Mon, 26 Jul 2010 17:58:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: ScottS-M</title>
		<link>http://scott.sherrillmix.com/blog/programmer/sas-macros-letting-sas-do-the-typing/comment-page-1/#comment-147982</link>
		<dc:creator>ScottS-M</dc:creator>
		<pubDate>Fri, 13 Nov 2009 23:43:08 +0000</pubDate>
		<guid isPermaLink="false">http://scott.sherrillmix.com/blog/programmer/sas-macros-letting-sas-do-the-typing/#comment-147982</guid>
		<description>@Toby
That sounds pretty identical to what I wrote:
&lt;blockquote&gt;This particular example could be done a few different ways (the easiest and probably better way being to merge the meancv dataset with the trees) but I hope it gives a decent introduction to SAS macros.&lt;/blockquote&gt;</description>
		<content:encoded><![CDATA[<p>@Toby<br />
That sounds pretty identical to what I wrote:</p>
<blockquote><p>This particular example could be done a few different ways (the easiest and probably better way being to merge the meancv dataset with the trees) but I hope it gives a decent introduction to SAS macros.</p></blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: Toby</title>
		<link>http://scott.sherrillmix.com/blog/programmer/sas-macros-letting-sas-do-the-typing/comment-page-1/#comment-147980</link>
		<dc:creator>Toby</dc:creator>
		<pubDate>Fri, 13 Nov 2009 23:19:56 +0000</pubDate>
		<guid isPermaLink="false">http://scott.sherrillmix.com/blog/programmer/sas-macros-letting-sas-do-the-typing/#comment-147980</guid>
		<description>Seems to me you have made a mountain out of a mole hill with the example.  While there are many uses of the macro language in SAS it is also over used by far too many to solve problems that are better solved in simplier manners.


If I assume your same starting data set here is a two step solution:



Proc Means
 Data = Trees NWay NoPrint ;
 Class Name ;
 Var Height ;
 Output Out = MeanSTD ( Drop = _Type_ _Freq_ )
        Mean = Mean STD = STD ;
Run ;



Proc SQL ;
Create Table Final As
 Select Trees.Name , Height , Mean , STD ,
        ( ( Height - Mean ) / STD ) As StHeight
  From Trees
       Left Join
       MeanSTD
       On Trees.Name = MeanSTD.Name
   Order By Name ;
Quit ;



SAS is a bunch of individual languages held together by data sets.  The macro language is nothing more than a way to create &quot;Open Code in Mass Quantity&quot;.  Which if used right can be a life saver or finger cramp saver (which ever you like).  However, it can just as easily and more often than not is, a problem maker that stunts the growth of programmer in learning the SAS language.</description>
		<content:encoded><![CDATA[<p>Seems to me you have made a mountain out of a mole hill with the example.  While there are many uses of the macro language in SAS it is also over used by far too many to solve problems that are better solved in simplier manners.</p>
<p>If I assume your same starting data set here is a two step solution:</p>
<p>Proc Means<br />
 Data = Trees NWay NoPrint ;<br />
 Class Name ;<br />
 Var Height ;<br />
 Output Out = MeanSTD ( Drop = _Type_ _Freq_ )<br />
        Mean = Mean STD = STD ;<br />
Run ;</p>
<p>Proc SQL ;<br />
Create Table Final As<br />
 Select Trees.Name , Height , Mean , STD ,<br />
        ( ( Height &#8211; Mean ) / STD ) As StHeight<br />
  From Trees<br />
       Left Join<br />
       MeanSTD<br />
       On Trees.Name = MeanSTD.Name<br />
   Order By Name ;<br />
Quit ;</p>
<p>SAS is a bunch of individual languages held together by data sets.  The macro language is nothing more than a way to create &#8220;Open Code in Mass Quantity&#8221;.  Which if used right can be a life saver or finger cramp saver (which ever you like).  However, it can just as easily and more often than not is, a problem maker that stunts the growth of programmer in learning the SAS language.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ScottS-M</title>
		<link>http://scott.sherrillmix.com/blog/programmer/sas-macros-letting-sas-do-the-typing/comment-page-1/#comment-146264</link>
		<dc:creator>ScottS-M</dc:creator>
		<pubDate>Thu, 29 Oct 2009 15:18:17 +0000</pubDate>
		<guid isPermaLink="false">http://scott.sherrillmix.com/blog/programmer/sas-macros-letting-sas-do-the-typing/#comment-146264</guid>
		<description>@Haes 
That I did. Thanks. I&#039;ll stick it in there now.</description>
		<content:encoded><![CDATA[<p>@Haes<br />
That I did. Thanks. I&#8217;ll stick it in there now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Haes</title>
		<link>http://scott.sherrillmix.com/blog/programmer/sas-macros-letting-sas-do-the-typing/comment-page-1/#comment-146209</link>
		<dc:creator>Haes</dc:creator>
		<pubDate>Thu, 29 Oct 2009 02:26:26 +0000</pubDate>
		<guid isPermaLink="false">http://scott.sherrillmix.com/blog/programmer/sas-macros-letting-sas-do-the-typing/#comment-146209</guid>
		<description>Hey there. Good tutorial. Just a point of note (which beffudled me for a second), you forgot the &#039;run;&#039; statement at the end of your macro.</description>
		<content:encoded><![CDATA[<p>Hey there. Good tutorial. Just a point of note (which beffudled me for a second), you forgot the &#8216;run;&#8217; statement at the end of your macro.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ScottS-M</title>
		<link>http://scott.sherrillmix.com/blog/programmer/sas-macros-letting-sas-do-the-typing/comment-page-1/#comment-132754</link>
		<dc:creator>ScottS-M</dc:creator>
		<pubDate>Wed, 20 May 2009 15:41:21 +0000</pubDate>
		<guid isPermaLink="false">http://scott.sherrillmix.com/blog/programmer/sas-macros-letting-sas-do-the-typing/#comment-132754</guid>
		<description>@anil kumar
You could probably use a %goto statement:
&lt;code&gt;
%MACRO test;
 %DO i=1 %TO 10;
  %PUT Working on &i;
  %IF &amp;i = 5 %THEN %DO
   %PUT Found an error;
   %GOTO ERROR;
  %END;
 %END;
 %ERROR:
%MEND;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>@anil kumar<br />
You could probably use a %goto statement:<br />
<code><br />
%MACRO test;<br />
 %DO i=1 %TO 10;<br />
  %PUT Working on &amp;i;<br />
  %IF &amp;i = 5 %THEN %DO<br />
   %PUT Found an error;<br />
   %GOTO ERROR;<br />
  %END;<br />
 %END;<br />
 %ERROR:<br />
%MEND;<br />
</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic page generated in 1.338 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-07-30 11:41:09 -->
