<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The SAS Reference</title>
	<atom:link href="http://sasreference.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sasreference.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sun, 17 Feb 2008 09:04:50 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='sasreference.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/680485f0bea49ad5990dc43c1a08cb08?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>The SAS Reference</title>
		<link>http://sasreference.wordpress.com</link>
	</image>
			<item>
		<title>Summing Missing Values</title>
		<link>http://sasreference.wordpress.com/2008/02/16/summing-missing-values/</link>
		<comments>http://sasreference.wordpress.com/2008/02/16/summing-missing-values/#comments</comments>
		<pubDate>Sat, 16 Feb 2008 09:01:40 +0000</pubDate>
		<dc:creator>sasreference</dc:creator>
				<category><![CDATA[Beginners]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[+]]></category>
		<category><![CDATA[adding]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[listing variables]]></category>
		<category><![CDATA[max]]></category>
		<category><![CDATA[min]]></category>
		<category><![CDATA[missing]]></category>
		<category><![CDATA[sas]]></category>
		<category><![CDATA[special missing]]></category>
		<category><![CDATA[sum]]></category>
		<category><![CDATA[sum of]]></category>

		<guid isPermaLink="false">http://sasreference.wordpress.com/?p=15</guid>
		<description><![CDATA[
Adding two figures and get a  different result from your expectation. Yes this is possible with SAS when missing or special missing values are included in your records. Let&#8217;s find out the difference between mathematics operators and functions which deals with computation taking the SUM function as an example.

Here is the rule: SAS functions [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sasreference.wordpress.com&blog=2554756&post=15&subd=sasreference&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img src="http://sasreference.files.wordpress.com/2008/02/calculator.jpg" alt="calculator.jpg" /></p>
<p>Adding two figures and get a  different result from your expectation. Yes this is possible with SAS when missing or special missing values are included in your records. Let&#8217;s find out the difference between mathematics operators and functions which deals with computation taking the SUM function as an example.</p>
<p><b><br />
Here is the rule:</b> SAS functions ignore missing values in their computation. So with the SUM function, the sum of 2 and a missing value is 2, whether it is missing with the + operator: 2 + . = .</p>
<p>Now, I shall detail the three SUM function notation.</p>
<p><b><font color="#ff6600">1. List values as individual SUM function parameters</font></b>: parameters of a SAS functions are delimited with commas. To compute the sum of several values, one can list them one after another withint the SUM function brackets using commas as delimiter.</p>
<p>newvar = sum(2,3,.);</p>
<p>Most of the time, the programmer won&#8217;t compute raw figures but will refer to values through variables:</p>
<p>newvar = sum(x,y,z);</p>
<p><font color="#ff6600"><b>2. Use the OF keyword to list values without commas </b></font>: to list the values to sum without comma, the OF keyword must be used.</p>
<p>newvar = sum (of 2 3 .) ;</p>
<p>newvar = sum(of test2 test3 test4);</p>
<p><font color="#ff6600"><b>3. Extension of the notation with the OF keyword</b></font> : in the previous example variables have a name a common basis and an integer incremented by 1. By defining an interval, listing the first and lasst variable joined by an hyphen, you should be able to save you from a work which become more and more boring as the number of variables increases.</p>
<p>newvar = sum(of test2-test4);</p>
<p>This notation is not specific to the SUM function. It can be used in many occasions such as the keep or drop function, an array, etc.<br />
<b><br />
Important: </b>Please note how important it is not to forget the OF keyword.  In the previous example, SAS would substract variables test4 to variable test2 if the OF keyword would be missing. The sum function would then have a single value.</p>
<p><b>Further Reading :</b> the MIN and MAX functions and their related operators &gt;&lt; and &lt;&gt; deal the same way as the SUM function and its + operator with missing values.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sasreference.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sasreference.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sasreference.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sasreference.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sasreference.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sasreference.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sasreference.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sasreference.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sasreference.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sasreference.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sasreference.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sasreference.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sasreference.wordpress.com&blog=2554756&post=15&subd=sasreference&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sasreference.wordpress.com/2008/02/16/summing-missing-values/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/061f57584e87bca731fa8f7b2ebfdf1d?s=96&#38;d=identicon" medium="image">
			<media:title type="html">sasreference</media:title>
		</media:content>

		<media:content url="http://sasreference.files.wordpress.com/2008/02/calculator.jpg" medium="image">
			<media:title type="html">calculator.jpg</media:title>
		</media:content>
	</item>
		<item>
		<title>Uppercase or Lowercase with SAS?</title>
		<link>http://sasreference.wordpress.com/2008/02/09/uppercase-or-lowercase-strings-with-sas/</link>
		<comments>http://sasreference.wordpress.com/2008/02/09/uppercase-or-lowercase-strings-with-sas/#comments</comments>
		<pubDate>Sat, 09 Feb 2008 09:46:34 +0000</pubDate>
		<dc:creator>sasreference</dc:creator>
				<category><![CDATA[Beginners]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[case-sensitive]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[lowcase]]></category>
		<category><![CDATA[lowercase]]></category>
		<category><![CDATA[sas]]></category>
		<category><![CDATA[upcase]]></category>
		<category><![CDATA[uppercase]]></category>

		<guid isPermaLink="false">http://sasreference.wordpress.com/?p=7</guid>
		<description><![CDATA[
When a programming language does not deal the same way with words having different cases, one says it is case-sensitive. What about SAS? Is it case-sensitive?
1. Words not affected by changes in case: most of the time SAS does not deal differently whether uppercase or lowercase is used. Here are a few examples:

SAS syntax (data, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sasreference.wordpress.com&blog=2554756&post=7&subd=sasreference&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img src="http://sasreference.files.wordpress.com/2008/02/uppercase.jpg" alt="uppercase.jpg" /></p>
<p>When a programming language does not deal the same way with words having different cases, one says it is case-sensitive. What about SAS? Is it case-sensitive?</p>
<p><b>1. Words not affected by changes in case</b>: most of the time SAS does not deal differently whether uppercase or lowercase is used. Here are a few examples:</p>
<ul>
<li>SAS syntax (data, proc, do, if, filename, etc.)</li>
<li>SAS library names (libname orig_data &#8216;C:/&#8217;;)</li>
<li>SAS data sets (data demo; set DEMO;)</li>
<li>Variables name (age, AGE, Age)</li>
</ul>
<p>If you look into you metadata using SAS dictionaries or proc contents procedure, you&#8217;ll see that all library names follow a standard notation regardless the original input name. Please note the exception of variable names which still appear in dictionaries with their original notation.</p>
<p><b>Tip</b>: Lowercases are easier to read. Therefore you&#8217;re highly recommended to use them. You can save uppercases for special occasions, for recognising bits in your code.</p>
<p><b>2. Quoted strings are case-sensitive: </b> here are three case-sensitive examples:</p>
<ul>
<li>Values of character variables (cntry=&#8217;UK&#8217;;)</li>
<li>Variables label (label cntry=&#8217;Country&#8217;;)</li>
<li>Data sets labels (data demo (label=(&#8216;Demography Panel&#8217;);)</li>
</ul>
<p>Those three values are strings defined within quotes. Therefore, cntry=&#8217;UK&#8217; is different from cntry=&#8217;Uk&#8217;.</p>
<p><b>3. Avoid mistakes using two SAS functions, UPCASE and LOWCASE</b>: to check the value of a variable regardless its case, you can make your comparison of standardised records (all uppercased or all lowercased). Otherwise you may end up missing out some records. Two functions are available UPCASE() and LOWCASE().</p>
<p><b>4. Example using the UPCASE function with a dictionary</b>: I personally use the UPCASE and LOWCASE functions to select records from SAS dictionaries. Here is an example where all records from the TABLES dictionary are selected when they refer to the WORK library.</p>
<p>proc sql ;<br />
   select *<br />
   from dictionary.tables<br />
   where upcase(libname)=’WORK’;<br />
quit;</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sasreference.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sasreference.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sasreference.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sasreference.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sasreference.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sasreference.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sasreference.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sasreference.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sasreference.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sasreference.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sasreference.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sasreference.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sasreference.wordpress.com&blog=2554756&post=7&subd=sasreference&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sasreference.wordpress.com/2008/02/09/uppercase-or-lowercase-strings-with-sas/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/061f57584e87bca731fa8f7b2ebfdf1d?s=96&#38;d=identicon" medium="image">
			<media:title type="html">sasreference</media:title>
		</media:content>

		<media:content url="http://sasreference.files.wordpress.com/2008/02/uppercase.jpg" medium="image">
			<media:title type="html">uppercase.jpg</media:title>
		</media:content>
	</item>
		<item>
		<title>4 Functions to Remove Blanks</title>
		<link>http://sasreference.wordpress.com/2008/01/29/4-functions-to-remove-blanks/</link>
		<comments>http://sasreference.wordpress.com/2008/01/29/4-functions-to-remove-blanks/#comments</comments>
		<pubDate>Tue, 29 Jan 2008 13:34:48 +0000</pubDate>
		<dc:creator>sasreference</dc:creator>
				<category><![CDATA[Beginners]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[blank]]></category>
		<category><![CDATA[call rxchange]]></category>
		<category><![CDATA[compbl]]></category>
		<category><![CDATA[compress]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[left]]></category>
		<category><![CDATA[lengthc]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[rxparse]]></category>
		<category><![CDATA[sas]]></category>
		<category><![CDATA[strip]]></category>
		<category><![CDATA[trim]]></category>
		<category><![CDATA[trimn]]></category>

		<guid isPermaLink="false">http://sasreference.wordpress.com/?p=13</guid>
		<description><![CDATA[1. Remove leading and trailing blanks using the STRIP function
Understand the old SAS programs and the TRIM and LEFT functions: until SAS 8.2 version, to remove leading blanks from a string, we would have first more them to the end of the string using the LEFT function and remove those trailing blanks with the TRIM [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sasreference.wordpress.com&blog=2554756&post=13&subd=sasreference&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><b>1. Remove leading and trailing blanks using the STRIP function</b></p>
<p><b>Understand the old SAS programs and the TRIM and LEFT functions</b>: until SAS 8.2 version, to remove leading blanks from a string, we would have first more them to the end of the string using the LEFT function and remove those trailing blanks with the TRIM function. This has several disadvantages:</p>
<ul>
<li>Two functions had to be used (TRIM and LEFT),</li>
<li>The order the functions appears had to be respected. Otherwise the trialing blanks would remain.</li>
<li>When this notation was used with am empty string, the result was a string of length 1 instead of 0. The TRIMN function which solves this issue only appeared with SAS 9.</li>
</ul>
<p><b>Making the most of the new syntax, the STRIP function</b>: since SAS 9, the STRIP function resolves the three issues. This function is equivalent to TRIMN(LEFT()).</p>
<p><b>2. Keep an unique blank between words using the COMPL function</b>: usually a single blank between words of your strings is needed. To remove any unecessary blanks, you can remove the COMPL function. If there are many trailing blanks, only one will remain.</p>
<p><b>3. Remove all the blanks using the COMPRESS function</b>: by default the COMPRESS function remove all the blanks from a string. To remove any other type of character, you can add a second parameter. But this is beyond today&#8217;s topic.</p>
<p><b>4. Remove les x first blanks using RXPARSE et CALL RXCHANGE statements</b>: the following notation can remplace any tect by another one. Here I shall restrict the discussion to blanks. First you have to define the value before and after in RXPARSE function. Then you define the three or even four parameters of the CALL RXCHANGE statement i.e.:</p>
<ul>
<li>recall the definition of RXPARSE, </li>
<li>precise teh variable to update</li>
<li>specify the number of time to conduct the update.</li>
<li>by default the original variable is updated. To create a new variable, a fourth parameter to CALL RXCHANGE can be added. The length of the new variable will be 200 unless it has been specifically defined beforehands. </p>
</li>
</ul>
<p><b>Tip</b>: Given that it cannot be more changes than characters in the string, the length of the string can be used to define the number of repetitions. This length, when it inlcude trailing blanks and resolve to 0 when no character is available can be found using the LENGTHC function.</p>
<p><b>Example</b>: here is a variable y with length 30, which is set based on the x variable without its six blanks.</p>
<p>data one;<br />
length y $30;<br />
x= ‘ ZZZ ABCD AB ‘ ;<br />
rx=rxparse(” ‘ ‘ to “);<br />
call rxchange (rx,lengthc(x),x,y);<br />
run;</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sasreference.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sasreference.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sasreference.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sasreference.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sasreference.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sasreference.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sasreference.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sasreference.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sasreference.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sasreference.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sasreference.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sasreference.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sasreference.wordpress.com&blog=2554756&post=13&subd=sasreference&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sasreference.wordpress.com/2008/01/29/4-functions-to-remove-blanks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/061f57584e87bca731fa8f7b2ebfdf1d?s=96&#38;d=identicon" medium="image">
			<media:title type="html">sasreference</media:title>
		</media:content>
	</item>
		<item>
		<title>Job Offer: SAS Consultants/Freelancers</title>
		<link>http://sasreference.wordpress.com/2008/01/18/job-offer-sas-consultantsfreelancers/</link>
		<comments>http://sasreference.wordpress.com/2008/01/18/job-offer-sas-consultantsfreelancers/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 22:24:24 +0000</pubDate>
		<dc:creator>sasreference</dc:creator>
				<category><![CDATA[Recruiting]]></category>
		<category><![CDATA[cologne]]></category>
		<category><![CDATA[consultant]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[DataFocus]]></category>
		<category><![CDATA[europe]]></category>
		<category><![CDATA[freelancer]]></category>
		<category><![CDATA[job]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[sas]]></category>

		<guid isPermaLink="false">http://sasreference.wordpress.com/2008/01/18/job-offer-sas-consultantsfreelancers/</guid>
		<description><![CDATA[
DataFocus GmbH is recruiting SAS consultants for its clients in the pharmaceutical industry, telecommunication and finance based in Europe. Freelancers are also welcomed.
Email: Véronique Bourcier veronique.bourcier@datafocus.de
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sasreference.wordpress.com&blog=2554756&post=6&subd=sasreference&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img src="http://sasreference.files.wordpress.com/2008/02/cologne_cathedral.jpg" alt="uppercase.jpg" /></p>
<p><a href="http://www.datafocus.de/" title="DataFocus GmbH">DataFocus GmbH</a> is recruiting SAS consultants for its clients in the pharmaceutical industry, telecommunication and finance based in Europe. Freelancers are also welcomed.</p>
<p>Email: Véronique Bourcier <a href="mailto:veronique.bourcier@datafocus.de">veronique.bourcier@datafocus.de</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sasreference.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sasreference.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sasreference.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sasreference.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sasreference.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sasreference.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sasreference.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sasreference.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sasreference.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sasreference.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sasreference.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sasreference.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sasreference.wordpress.com&blog=2554756&post=6&subd=sasreference&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sasreference.wordpress.com/2008/01/18/job-offer-sas-consultantsfreelancers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/061f57584e87bca731fa8f7b2ebfdf1d?s=96&#38;d=identicon" medium="image">
			<media:title type="html">sasreference</media:title>
		</media:content>

		<media:content url="http://sasreference.files.wordpress.com/2008/02/cologne_cathedral.jpg" medium="image">
			<media:title type="html">uppercase.jpg</media:title>
		</media:content>
	</item>
	</channel>
</rss>