<?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: Must be a better way to do this (missing values) in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Must-be-a-better-way-to-do-this-missing-values/m-p/63373#M18017</link>
    <description>I would seriously look into creating one or more INFORMATS using Proc Format and INVALUE. &lt;BR /&gt;
&lt;BR /&gt;
Something like this would set all values less than 0 to missing. The only issue is assigning the informat while using Proc Import. (Hint the log should contain a bunch of INFORMAT, FORMAT statements after the first run. Copy the code from the Log to the editor and apply as needed)&lt;BR /&gt;
&lt;BR /&gt;
Proc format;&lt;BR /&gt;
invalue groupval 0- high= _same_&lt;BR /&gt;
                 other= .;&lt;BR /&gt;
run;</description>
    <pubDate>Tue, 18 Aug 2009 23:06:33 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2009-08-18T23:06:33Z</dc:date>
    <item>
      <title>Must be a better way to do this (missing values)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Must-be-a-better-way-to-do-this-missing-values/m-p/63369#M18013</link>
      <description>Hey all, I have an Access database that with a number of fields that use "-9999" as a "missing" value.  I am going to read the data into SAS using Proc Import (I'm slightly scared of other methods) and then use a Data statement to translate the -9999 to the missing character.&lt;BR /&gt;
&lt;BR /&gt;
This seems like a clunky way to do things, particularly with the sheer number of variables that are set up in this fashion.  Is this the best way to do it, or is there another way (maybe ditch the Proc Import or streamline the Data statement)?&lt;BR /&gt;
&lt;BR /&gt;
Thank you very much in advance for any help you can offer.</description>
      <pubDate>Tue, 11 Aug 2009 21:34:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Must-be-a-better-way-to-do-this-missing-values/m-p/63369#M18013</guid>
      <dc:creator>GVeers</dc:creator>
      <dc:date>2009-08-11T21:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Must be a better way to do this (missing values)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Must-be-a-better-way-to-do-this-missing-values/m-p/63370#M18014</link>
      <description>Here is some DATA step code to consider using, an explicit array to address numeric variables only:&lt;BR /&gt;
&lt;BR /&gt;
ARRAY a_num (*) _numeric_;&lt;BR /&gt;
do i=1 to dim(a_num);&lt;BR /&gt;
  if &lt;YOUR_VAR_NAME&gt; = -999 then &lt;YOUR_VAR_NAME&gt; = .;&lt;BR /&gt;
end;&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;/YOUR_VAR_NAME&gt;&lt;/YOUR_VAR_NAME&gt;</description>
      <pubDate>Tue, 11 Aug 2009 22:02:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Must-be-a-better-way-to-do-this-missing-values/m-p/63370#M18014</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-08-11T22:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: Must be a better way to do this (missing values)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Must-be-a-better-way-to-do-this-missing-values/m-p/63371#M18015</link>
      <description>I see.  Thank you very much for the reply.</description>
      <pubDate>Wed, 12 Aug 2009 13:14:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Must-be-a-better-way-to-do-this-missing-values/m-p/63371#M18015</guid>
      <dc:creator>GVeers</dc:creator>
      <dc:date>2009-08-12T13:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Must be a better way to do this (missing values)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Must-be-a-better-way-to-do-this-missing-values/m-p/63372#M18016</link>
      <description>you can use Scott's code this way:&lt;BR /&gt;
&lt;BR /&gt;
ARRAY a_num (*) _numeric_;&lt;BR /&gt;
do i=1 to dim(a_num);&lt;BR /&gt;
if a_num(i) = -9999 then a_num(i) = .;&lt;BR /&gt;
end;&lt;BR /&gt;
&lt;BR /&gt;
and all numeric variables are handled automatically without your having to name them.</description>
      <pubDate>Thu, 13 Aug 2009 05:38:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Must-be-a-better-way-to-do-this-missing-values/m-p/63372#M18016</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2009-08-13T05:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Must be a better way to do this (missing values)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Must-be-a-better-way-to-do-this-missing-values/m-p/63373#M18017</link>
      <description>I would seriously look into creating one or more INFORMATS using Proc Format and INVALUE. &lt;BR /&gt;
&lt;BR /&gt;
Something like this would set all values less than 0 to missing. The only issue is assigning the informat while using Proc Import. (Hint the log should contain a bunch of INFORMAT, FORMAT statements after the first run. Copy the code from the Log to the editor and apply as needed)&lt;BR /&gt;
&lt;BR /&gt;
Proc format;&lt;BR /&gt;
invalue groupval 0- high= _same_&lt;BR /&gt;
                 other= .;&lt;BR /&gt;
run;</description>
      <pubDate>Tue, 18 Aug 2009 23:06:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Must-be-a-better-way-to-do-this-missing-values/m-p/63373#M18017</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2009-08-18T23:06:33Z</dc:date>
    </item>
  </channel>
</rss>

