<?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/"
	>

<channel>
	<title>Statskom</title>
	<atom:link href="http://statskom.com/tag/proc-contents/feed/" rel="self" type="application/rss+xml" />
	<link>http://statskom.com</link>
	<description>Clinical programming</description>
	<lastBuildDate>Thu, 05 Oct 2017 09:04:02 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.8.41</generator>
	<item>
		<title>SAS tips &amp; tricks #1 – The VARNUM function</title>
		<link>http://statskom.com/sas-tips-tricks-1-the-varnum-function/</link>
		<comments>http://statskom.com/sas-tips-tricks-1-the-varnum-function/#comments</comments>
		<pubDate>Fri, 21 Feb 2014 19:55:39 +0000</pubDate>
		<dc:creator><![CDATA[Andrew N]]></dc:creator>
				<category><![CDATA[SAS Tips & Tricks]]></category>
		<category><![CDATA[DICTIONARY TABLES]]></category>
		<category><![CDATA[PROC CONTENTS]]></category>
		<category><![CDATA[SAS]]></category>
		<category><![CDATA[VARNUM]]></category>

		<guid isPermaLink="false">http://statskom.com/?p=214</guid>
		<description><![CDATA[<p>A couple of well known ways to tell whether a variable is present in a dataset  include using a PROC CONTENTS or by referring to the SASHELP.VCOLUMN Dictionary Table, a perhaps lesser known approach is to utilise the VARNUM function.&#8230; </p><p>The post <a rel="nofollow" href="http://statskom.com/sas-tips-tricks-1-the-varnum-function/">SAS tips &#038; tricks #1 – The VARNUM function</a> appeared first on <a rel="nofollow" href="http://statskom.com">Statskom</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><span style="font-size: medium;">A couple of well known ways to tell whether a variable is present in a dataset  include using a PROC CONTENTS or by referring to the SASHELP.VCOLUMN Dictionary Table, a perhaps lesser known approach is to utilise the VARNUM function.</span></p>
<p><span style="font-size: medium;">The VARNUM function returns the number of a variable’s position within a dataset, or 0 if a variable is not present in a dataset. This value can then be used to control subsequent processing steps, for example,  only executing steps if a particular variable is present in a given dataset.</span></p>
<p><span style="font-size: medium;">The function is used in combination with the OPEN function as shown below.</span></p>
<p><span style="font-size: medium;">In this example we test to see whether the variable HEIGHT exists in the SASHELP.CLASS dataset. The variable is the fourth column within the dataset and so the function returns the value 4. In our example we’ve assigned this value to the macro variable HEIGHT_EXIST, so that it is readily available in subsequent steps.</span></p>
<blockquote>
<pre><span style="color: #888888;"><b>DATA</b> </span>_null_;
  dsid=OPEN("sashelp.class");
  CALL SYMPUTX("height_exist",VARNUM(dsid,"height"));
<b>RUN</b>;</pre>
</blockquote>
<p><span style="font-size: medium;">The VARNUM function can also be used in combination with other functions, for example VARTYPE and VARLABEL to gain additional information about the attributes of a variable.  </span></p>
<p><span style="font-size: medium;">See how in our next SAS Tips &amp; Tricks blog.</span></p>
<p>The post <a rel="nofollow" href="http://statskom.com/sas-tips-tricks-1-the-varnum-function/">SAS tips &#038; tricks #1 – The VARNUM function</a> appeared first on <a rel="nofollow" href="http://statskom.com">Statskom</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://statskom.com/sas-tips-tricks-1-the-varnum-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
