<?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: Numeric variable with hidden &amp;quot;character&amp;quot; values in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Numeric-variable-with-hidden-quot-character-quot-values/m-p/358821#M10773</link>
    <description>&lt;P&gt;Sounds like you have missing values of .T and .U&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;.A thru .Z are all valid missing values as us ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 May 2017 19:23:13 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2017-05-15T19:23:13Z</dc:date>
    <item>
      <title>Numeric variable with hidden "character" values</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Numeric-variable-with-hidden-quot-character-quot-values/m-p/358819#M10772</link>
      <description>&lt;P&gt;Please read post before replying.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was cleaning a SAS dataset of laboratory values when I found&amp;nbsp;hidden values in a&amp;nbsp;numeric variable. FASTGLU is a numeric value with a format of BEST12. After I initially attempted to remove all missing values (&lt;FONT face="Courier New" size="2"&gt;if FASTGLU^=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;), I found there were still missing values left in the dataset when I ran proc means.&amp;nbsp;After removing all of the valid values, &amp;nbsp;I found these remaining missings&amp;nbsp;values via the table editor, they appeared as "T"s (and one "U"). I double checked that FASTGLU&amp;nbsp;is a numeric variable. I tried to run proc freq and proc means&amp;nbsp;on these values,&amp;nbsp;but&amp;nbsp;the values behave&amp;nbsp;as missings. I&amp;nbsp;tried removing the variable format (by proc databases)&amp;nbsp; to see if there is a certain value associated with "T" or "U" (no luck). I used the SAS export wizard to export the data to Excel to find the values. When exported, FASTGLU is a column of blank cells.&amp;nbsp; The column label for FASTGLU is &amp;nbsp;"Fasting serum glucose (mg/dL, .T if not fasting)" , so it's a&amp;nbsp; programming trick with limited use. I can visually see from FASTGLU=T that there should be a nonfasting glucose available but I can't program "if FASTGLU=T then GLUCOSE=NONFASTGLU"&amp;nbsp; because SAS recognizes FASTGLU=T as a missing value. I'm just curious about this situation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's my code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;datasets&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;lib&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=work noprint;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;modify&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; GluCheck;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;attrib&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;_all_&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;label&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;' '&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;attrib&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;_all_&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;means&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=GluCheck &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;noprint&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/*Get Min/Max of Valid Values*/&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;var&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; FASTGLU;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;output&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=GluStat (drop=_TYPE_ _FREQ_) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Min&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=Gmin &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Max&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=Gmax;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;run&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;/*Add Min/Max to Glucose data*/&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; GluAddStat &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; * &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;GluCheck, GluStat;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; JustGlu (&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;drop&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=Gmin Gmax);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; GluAddStat (&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=(if FASTGLU^=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;. &lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)); &lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/*drop missing values*/&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; (FASTGLU &amp;lt; Gmin or FASTGLU &amp;gt; Gmax); &lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/*drop values between min and max*/&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;means&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=JustGlu &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;n&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;mean&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;min&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;max&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;nmiss&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;var&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; FASTGLU;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;title&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="2"&gt;'FASTGLU - Remaining Missing Values'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;freq&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=JustGlu;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;tables&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; FASTGLU;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;title&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="2"&gt;'FASTGLU - Remaining Missing Values'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13839i780CC719B1F57BA6/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="fasting_glucose.JPG" title="fasting_glucose.JPG" /&gt;</description>
      <pubDate>Mon, 15 May 2017 19:20:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Numeric-variable-with-hidden-quot-character-quot-values/m-p/358819#M10772</guid>
      <dc:creator>slangan</dc:creator>
      <dc:date>2017-05-15T19:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric variable with hidden "character" values</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Numeric-variable-with-hidden-quot-character-quot-values/m-p/358821#M10773</link>
      <description>&lt;P&gt;Sounds like you have missing values of .T and .U&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;.A thru .Z are all valid missing values as us ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2017 19:23:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Numeric-variable-with-hidden-quot-character-quot-values/m-p/358821#M10773</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-05-15T19:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric variable with hidden "character" values</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Numeric-variable-with-hidden-quot-character-quot-values/m-p/358822#M10774</link>
      <description>&lt;P&gt;These are also missing values, represented as .T or .U in SAS code, and shown as T or U in the viewtable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead of &lt;FONT face="Courier New" size="2"&gt;if FASTGLU^=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;FONT face="arial,helvetica,sans-serif"&gt;you want to use&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;CODE class=" language-sas"&gt;if not missing(fastglu);&lt;/CODE&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2017 19:24:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Numeric-variable-with-hidden-quot-character-quot-values/m-p/358822#M10774</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-05-15T19:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric variable with hidden "character" values</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Numeric-variable-with-hidden-quot-character-quot-values/m-p/358825#M10775</link>
      <description>&lt;P&gt;The special missing have uses. Here is one example:&lt;/P&gt;
&lt;PRE&gt;data example;
   input x;
   if x= 6 then x=.D;
   if x= 7 then x=.R;

datalines;
1
2
3
4
5
6
7
;
run;

proc format library=work;
value MyDr
.D="Don't Know"
.R="Refused";
run;
proc print data=example;
   format x MyDR.;
run;
Proc freq data=example;
  tables x;
run;&lt;/PRE&gt;
&lt;P&gt;The data step simulates reading an external data set with specific code values that would be considered missing for most analysis. Then use of the custom format allows creating report text to explain why the spefic values are missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2017 19:41:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Numeric-variable-with-hidden-quot-character-quot-values/m-p/358825#M10775</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-05-15T19:41:17Z</dc:date>
    </item>
  </channel>
</rss>

