<?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: How to use SAS to determine where values are missing? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-use-SAS-to-determine-where-values-are-missing/m-p/615481#M18765</link>
    <description>&lt;P&gt;An example to illustrate&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;response.&amp;nbsp; Try running:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data df;
   infile cards;
         
    input temp $4.
          speed $7.
      @14 measure1 
      @18 measure2 
      @23 measure3 
      @28 measure4 ;
list;	  
datalines;
cold slow    .   2.7  6.6  3.1
warm medium  4.2 5.1  7.9  9.1
hot  fast    9.4 11.0 .    6.8
cool         .   .    9.1  8.9
cool medium  6.1 4.3  12.2 3.7
     slow    .   2.9  3.3  1.7
     slow    .   2.9  3.3  1.7
;;;;
proc print;

proc format;
     value $missfmt ' '='Missing' other='Not Missing';
     value  missfmt  . ='Missing' other='Not Missing';

proc freq data=df;
     format _CHARACTER_ $missfmt.;
     tables _CHARACTER_ / missing missprint nocum nopercent;
       
     format _NUMERIC_ missfmt.;
     tables _NUMERIC_ / missing missprint nocum nopercent;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;SAS permits the use of _CHARACTER_ to denote all character variables in the data set.&amp;nbsp; Likewise, _NUMERIC_ denotes all numeric variables.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For new users, SAS documentation includes the document, &lt;EM&gt;SAS 9.4 Language Reference: Concepts&lt;/EM&gt;.&amp;nbsp; For working with missing values see:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p175x77t7k6kggn1io94yedqagl3.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p175x77t7k6kggn1io94yedqagl3.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Jan 2020 21:39:02 GMT</pubDate>
    <dc:creator>rbetancourt</dc:creator>
    <dc:date>2020-01-06T21:39:02Z</dc:date>
    <item>
      <title>How to use SAS to determine where values are missing?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-use-SAS-to-determine-where-values-are-missing/m-p/615447#M18759</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I haven't attempted any code for this as of yet, being that I'm unsure of where to start. My question is how can I use SAS to identify where values may be missing for certain observations? For example, if each observation is supposed to have first name, last name, and age variables, yet some observations are missing at least one of these variables, how can I use SAS to tell me who/how many are missing a value?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 19:58:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-use-SAS-to-determine-where-values-are-missing/m-p/615447#M18759</guid>
      <dc:creator>SM8</dc:creator>
      <dc:date>2020-01-06T19:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to use SAS to determine where values are missing?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-use-SAS-to-determine-where-values-are-missing/m-p/615449#M18760</link>
      <description>&lt;P&gt;You an use the MISSING() function, for example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if missing(variablename) then do;
     ... some commands ...
end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Jan 2020 20:00:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-use-SAS-to-determine-where-values-are-missing/m-p/615449#M18760</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-01-06T20:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to use SAS to determine where values are missing?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-use-SAS-to-determine-where-values-are-missing/m-p/615450#M18761</link>
      <description>&lt;P&gt;proc freq shows you the number of missing values in the output.&lt;/P&gt;
&lt;P&gt;The missing() function can be used for testing while you process your dataset in a data step.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 20:01:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-use-SAS-to-determine-where-values-are-missing/m-p/615450#M18761</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-06T20:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to use SAS to determine where values are missing?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-use-SAS-to-determine-where-values-are-missing/m-p/615454#M18763</link>
      <description>Are you using SAS Studio or EG? If so, try running the characterize data task and it will give you a good overview of your data.</description>
      <pubDate>Mon, 06 Jan 2020 20:06:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-use-SAS-to-determine-where-values-are-missing/m-p/615454#M18763</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-01-06T20:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to use SAS to determine where values are missing?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-use-SAS-to-determine-where-values-are-missing/m-p/615481#M18765</link>
      <description>&lt;P&gt;An example to illustrate&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;response.&amp;nbsp; Try running:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data df;
   infile cards;
         
    input temp $4.
          speed $7.
      @14 measure1 
      @18 measure2 
      @23 measure3 
      @28 measure4 ;
list;	  
datalines;
cold slow    .   2.7  6.6  3.1
warm medium  4.2 5.1  7.9  9.1
hot  fast    9.4 11.0 .    6.8
cool         .   .    9.1  8.9
cool medium  6.1 4.3  12.2 3.7
     slow    .   2.9  3.3  1.7
     slow    .   2.9  3.3  1.7
;;;;
proc print;

proc format;
     value $missfmt ' '='Missing' other='Not Missing';
     value  missfmt  . ='Missing' other='Not Missing';

proc freq data=df;
     format _CHARACTER_ $missfmt.;
     tables _CHARACTER_ / missing missprint nocum nopercent;
       
     format _NUMERIC_ missfmt.;
     tables _NUMERIC_ / missing missprint nocum nopercent;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;SAS permits the use of _CHARACTER_ to denote all character variables in the data set.&amp;nbsp; Likewise, _NUMERIC_ denotes all numeric variables.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For new users, SAS documentation includes the document, &lt;EM&gt;SAS 9.4 Language Reference: Concepts&lt;/EM&gt;.&amp;nbsp; For working with missing values see:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p175x77t7k6kggn1io94yedqagl3.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p175x77t7k6kggn1io94yedqagl3.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 21:39:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-use-SAS-to-determine-where-values-are-missing/m-p/615481#M18765</guid>
      <dc:creator>rbetancourt</dc:creator>
      <dc:date>2020-01-06T21:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to use SAS to determine where values are missing?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-use-SAS-to-determine-where-values-are-missing/m-p/615486#M18766</link>
      <description>&lt;P&gt;To get a count of missing values for a single observation, use (in a DATA step):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;n_missing = cmiss(of _all_);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get a more useful report about which variables are missing, you need to supply a little more information ... what should be included in the report?&amp;nbsp; What if there are 100 variables with a missing value?&amp;nbsp; What variable identifies the observation so you know which observation to check later?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 22:06:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-use-SAS-to-determine-where-values-are-missing/m-p/615486#M18766</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-01-06T22:06:33Z</dc:date>
    </item>
  </channel>
</rss>

