<?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: Blank Values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Blank-Values/m-p/239452#M44053</link>
    <description>&lt;P&gt;When character strings are blank, refer to them as a blank within quotes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;if variable=' ' then delete;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck.&lt;/P&gt;</description>
    <pubDate>Tue, 15 Dec 2015 23:35:35 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2015-12-15T23:35:35Z</dc:date>
    <item>
      <title>Blank Values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blank-Values/m-p/239450#M44051</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have a question on how to work with variables with blank values. I recently imported in a dataset using the SAS import wizard. When I brought it in, I have a variable that has some missing values. When it brought the dataset in, insteading of assigning those values as a '.' they're blank instead. I'm trying to use that to exclude those cases, however, it isn't working since the values are blank. Any insight would be appreciated!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 23:11:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blank-Values/m-p/239450#M44051</guid>
      <dc:creator>endofline</dc:creator>
      <dc:date>2015-12-15T23:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Blank Values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blank-Values/m-p/239452#M44053</link>
      <description>&lt;P&gt;When character strings are blank, refer to them as a blank within quotes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;if variable=' ' then delete;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 23:35:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blank-Values/m-p/239452#M44053</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-12-15T23:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Blank Values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blank-Values/m-p/239453#M44054</link>
      <description>Character variables denote missing as 'blank values'.&lt;BR /&gt;Numeric variables denote missing as '.'.&lt;BR /&gt;&lt;BR /&gt;Use can use the missing()/nmiss/cmiss functions to determine a missing value.&lt;BR /&gt;&lt;BR /&gt;For example&lt;BR /&gt;if missing(var) then do ...;</description>
      <pubDate>Tue, 15 Dec 2015 23:35:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blank-Values/m-p/239453#M44054</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-15T23:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Blank Values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blank-Values/m-p/239454#M44055</link>
      <description>&lt;P&gt;I assume that it is a character variable, not a numeric variable. Indeed, missing values of character variables are stored as single blanks, not periods. To exclude observations with missing values for&amp;nbsp;that variable you could use a WHERE or IF contition of the form &lt;FONT face="courier new,courier"&gt;varname ne ' '&lt;FONT face="arial,helvetica,sans-serif"&gt; or, more generally (suitable also for numeric variables),&lt;/FONT&gt;&amp;nbsp;not missing(varname)&lt;FONT face="arial,helvetica,sans-serif"&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Example:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
length c $8;
input c;
cards;
abc
.
def
; /* Please note that the period in the raw data indicates the missing value although C is character! */

data want;
set have;
where not missing(c);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Dec 2015 23:38:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blank-Values/m-p/239454#M44055</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2015-12-15T23:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Blank Values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blank-Values/m-p/340059#M77673</link>
      <description>&lt;P&gt;To check if&amp;nbsp;a cell is empty, do not do&lt;/P&gt;
&lt;P&gt;if var='';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;use&amp;nbsp;the function &lt;FONT face="Verdana"&gt;anyalnum&lt;/FONT&gt;&amp;nbsp;:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Verdana" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Verdana" size="3"&gt; anyalnum(substr(strip(var),&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Verdana" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Verdana" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="3"&gt;))&amp;nbsp;= &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Verdana" size="3"&gt;0 then A="empty____"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Verdana" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Verdana" size="3"&gt; anyalnum(substr(strip(var),&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Verdana" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Verdana" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="3"&gt;))&amp;nbsp;ne &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Verdana" size="3"&gt;0 then A="not empty"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2017 19:01:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blank-Values/m-p/340059#M77673</guid>
      <dc:creator>nketata</dc:creator>
      <dc:date>2017-03-10T19:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Blank Values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blank-Values/m-p/340060#M77674</link>
      <description>&lt;P&gt;Tell us why you make that suggestion.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2017 19:03:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blank-Values/m-p/340060#M77674</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-03-10T19:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Blank Values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blank-Values/m-p/340066#M77675</link>
      <description>&lt;P&gt;I imported a file from Excel using the command&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Verdana" size="3"&gt;libname&lt;/FONT&gt;&lt;FONT face="Verdana" size="3"&gt;&amp;nbsp;go pcfiles path = &lt;/FONT&gt;&lt;FONT color="#800080" face="Verdana" size="3"&gt;C:\temp\myfile.xlsx'&lt;/FONT&gt;&lt;FONT face="Verdana" size="3"&gt; textsize = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Verdana" size="3"&gt;32767&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Verdana" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Verdana" size="3"&gt;&amp;nbsp;nicefile ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Verdana" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Verdana" size="3"&gt; go.'Sheet1$'n; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Verdana" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Verdana" size="3"&gt; _N_=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Verdana" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Verdana" size="3"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Verdana" size="3"&gt;call&lt;/FONT&gt;&lt;FONT face="Verdana" size="3"&gt; execute (&lt;/FONT&gt;&lt;FONT color="#800080" face="Verdana" size="3"&gt;'proc sort data=nicefile; by var1; run;'&lt;/FONT&gt;&lt;FONT face="Verdana" size="3"&gt;); &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Verdana" size="3"&gt;run&lt;/FONT&gt;&lt;FONT face="Verdana" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Verdana" size="3"&gt;libname&lt;/FONT&gt;&lt;FONT face="Verdana" size="3"&gt;&amp;nbsp;go &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Verdana" size="3"&gt;clear&lt;/FONT&gt;&lt;FONT face="Verdana" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Verdana" size="3"&gt;and I had a process based on missing values in a character variables.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Verdana" size="3"&gt;Some cells&amp;nbsp;&lt;FONT face="arial black,avant garde"&gt;looked empty&lt;/FONT&gt; but they where not, &amp;nbsp;so my condition if var1='' was sometimes not valid.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Verdana" size="3"&gt;Hence the use of the function &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Verdana" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Verdana" size="3"&gt; anyalnum(substr(strip(var1),&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Verdana" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Verdana" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="3"&gt;))&amp;nbsp;ne &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Verdana" size="3"&gt;0 &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Verdana" size="3"&gt;&lt;FONT face="Verdana"&gt;to make sure var1 starts with a letter or a number.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2017 19:15:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blank-Values/m-p/340066#M77675</guid>
      <dc:creator>nketata</dc:creator>
      <dc:date>2017-03-10T19:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Blank Values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blank-Values/m-p/340120#M77698</link>
      <description>&lt;P&gt;I think your advice is useful for eliminating all&amp;nbsp;cells that don't contain numbers or letters, but I'm uncomfortable designating it as a way to see&amp;nbsp;"if a cell is empty".&amp;nbsp;I would not term a cell with non-printable characters as "empty", even if it is unwanted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;x='09'x;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;put x= ;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* X looks like a true blank */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;put x=hex2.;&amp;nbsp; /* but printed in hex, we see it is not a hex 20 (e.g. a true blank) */&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2017 22:11:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blank-Values/m-p/340120#M77698</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-03-10T22:11:42Z</dc:date>
    </item>
  </channel>
</rss>

