<?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: Handling Missing values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468042#M119510</link>
    <description>&lt;P&gt;I think ARRAYs would work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But in general, the easiest way to handle missing values is to NOT convert them to –9. SAS knows what to do with missing values, it does not know what to do with –9.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jun 2018 13:35:10 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2018-06-06T13:35:10Z</dc:date>
    <item>
      <title>Handling Missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468041#M119509</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have data with missing values. Is there&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;anyway&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;I can convert missing values ( .&amp;nbsp;or " ") into '-9' regardless of the type of variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input id name$ gen$ PROCHI DATE TC HDL LDL Ttg;&lt;BR /&gt;datalines;&lt;BR /&gt;1&amp;nbsp; &amp;nbsp;ram&amp;nbsp; &amp;nbsp; &amp;nbsp; male&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp;1.1&amp;nbsp; &amp;nbsp;8.0&amp;nbsp; &amp;nbsp;3.0&amp;nbsp; &amp;nbsp;1.45&amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;2&amp;nbsp; &amp;nbsp;mohan male&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp;1.1&amp;nbsp; &amp;nbsp;8.5&amp;nbsp; &amp;nbsp;2.9&amp;nbsp; &amp;nbsp;1.24&amp;nbsp; &amp;nbsp; &amp;nbsp;.&lt;BR /&gt;3&amp;nbsp; &amp;nbsp;shyam&amp;nbsp; &amp;nbsp;.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp;2.1&amp;nbsp; &amp;nbsp;6.8&amp;nbsp; &amp;nbsp;3.1&amp;nbsp; &amp;nbsp; 2.23&amp;nbsp; &amp;nbsp; 2&amp;nbsp;&lt;BR /&gt;4&amp;nbsp; &amp;nbsp;radha&amp;nbsp; &amp;nbsp;female&amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp;2.1&amp;nbsp; &amp;nbsp;7.2&amp;nbsp; &amp;nbsp;3.8&amp;nbsp; &amp;nbsp; 3.80&amp;nbsp; &amp;nbsp; .&lt;BR /&gt;5&amp;nbsp; &amp;nbsp;gita&amp;nbsp; &amp;nbsp; &amp;nbsp; female&amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp;2.1&amp;nbsp; &amp;nbsp; .&amp;nbsp; &amp;nbsp; &amp;nbsp; 2.7&amp;nbsp; &amp;nbsp; 3.45&amp;nbsp; &amp;nbsp; 3&lt;BR /&gt;6&amp;nbsp; &amp;nbsp;sita&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp;3.1&amp;nbsp; &amp;nbsp; 8.9&amp;nbsp; 6.8&amp;nbsp; &amp;nbsp; 4.56&amp;nbsp; &amp;nbsp; 2&lt;BR /&gt;7&amp;nbsp; &amp;nbsp;ranu&amp;nbsp; &amp;nbsp; &amp;nbsp;female&amp;nbsp; 3&amp;nbsp; &amp;nbsp; 2.1&amp;nbsp; &amp;nbsp;7.5&amp;nbsp; &amp;nbsp;5.9&amp;nbsp; &amp;nbsp; 1.83&amp;nbsp; &amp;nbsp;5&lt;BR /&gt;8&amp;nbsp; &amp;nbsp;tina&amp;nbsp; &amp;nbsp; &amp;nbsp; female&amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp;2.1&amp;nbsp; &amp;nbsp;3.6&amp;nbsp; &amp;nbsp;2.8&amp;nbsp; &amp;nbsp; 1.23&amp;nbsp; &amp;nbsp;8&lt;BR /&gt;9&amp;nbsp; &amp;nbsp;shan&amp;nbsp; &amp;nbsp; male&amp;nbsp; &amp;nbsp; &amp;nbsp; 4&amp;nbsp; &amp;nbsp;8.1&amp;nbsp; &amp;nbsp;2.8&amp;nbsp; &amp;nbsp;1.1&amp;nbsp; &amp;nbsp; 1.67&amp;nbsp; &amp;nbsp;9&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data I want&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;like&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1&amp;nbsp; &amp;nbsp;ram&amp;nbsp; &amp;nbsp; &amp;nbsp; male&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp;1.1&amp;nbsp; &amp;nbsp;8.0&amp;nbsp; &amp;nbsp;3.0&amp;nbsp; &amp;nbsp;1.45&amp;nbsp; &amp;nbsp; 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp;mohan male&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp;1.1&amp;nbsp; &amp;nbsp;8.5&amp;nbsp; &amp;nbsp;2.9&amp;nbsp; &amp;nbsp;1.24&amp;nbsp; &amp;nbsp; &amp;nbsp;-9&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3&amp;nbsp; &amp;nbsp;shyam&amp;nbsp; &amp;nbsp;-9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp;2.1&amp;nbsp; &amp;nbsp;6.8&amp;nbsp; &amp;nbsp;3.1&amp;nbsp; &amp;nbsp; 2.23&amp;nbsp; &amp;nbsp; 2&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4&amp;nbsp; &amp;nbsp;radha&amp;nbsp; &amp;nbsp;female&amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp;2.1&amp;nbsp; &amp;nbsp;7.2&amp;nbsp; &amp;nbsp;3.8&amp;nbsp; &amp;nbsp; 3.80&amp;nbsp; &amp;nbsp; -9&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5&amp;nbsp; &amp;nbsp;gita&amp;nbsp; &amp;nbsp; &amp;nbsp; female&amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp;2.1&amp;nbsp; &amp;nbsp; -9&amp;nbsp; &amp;nbsp; &amp;nbsp; 2.7&amp;nbsp; &amp;nbsp; 3.45&amp;nbsp; &amp;nbsp; 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;6&amp;nbsp; &amp;nbsp;sita&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp;3.1&amp;nbsp; &amp;nbsp; 8.9&amp;nbsp; 6.8&amp;nbsp; &amp;nbsp; 4.56&amp;nbsp; &amp;nbsp; 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;7&amp;nbsp; &amp;nbsp;ranu&amp;nbsp; &amp;nbsp; &amp;nbsp;female&amp;nbsp; 3&amp;nbsp; &amp;nbsp; 2.1&amp;nbsp; &amp;nbsp;7.5&amp;nbsp; &amp;nbsp;5.9&amp;nbsp; &amp;nbsp; 1.83&amp;nbsp; &amp;nbsp;5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;8&amp;nbsp; &amp;nbsp;tina&amp;nbsp; &amp;nbsp; &amp;nbsp; female&amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp;2.1&amp;nbsp; &amp;nbsp;3.6&amp;nbsp; &amp;nbsp;2.8&amp;nbsp; &amp;nbsp; 1.23&amp;nbsp; &amp;nbsp;8&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;9&amp;nbsp; &amp;nbsp;shan&amp;nbsp; &amp;nbsp; male&amp;nbsp; &amp;nbsp; &amp;nbsp; 4&amp;nbsp; &amp;nbsp;8.1&amp;nbsp; &amp;nbsp;2.8&amp;nbsp; &amp;nbsp;1.1&amp;nbsp; &amp;nbsp; 1.67&amp;nbsp; &amp;nbsp;9&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have tried a below code-&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;set want ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if&amp;nbsp;name = " " then name = "-9";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if TC = . then TC = -9 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if Ttg = . then Ttg = -9;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But if we have 100 variables, it's not possible to write all the variables in one command. Is there any other way?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 13:31:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468041#M119509</guid>
      <dc:creator>mehul4frnds</dc:creator>
      <dc:date>2018-06-06T13:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468042#M119510</link>
      <description>&lt;P&gt;I think ARRAYs would work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But in general, the easiest way to handle missing values is to NOT convert them to –9. SAS knows what to do with missing values, it does not know what to do with –9.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 13:35:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468042#M119510</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-06-06T13:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468044#M119511</link>
      <description>&lt;P&gt;And what will you do with an empty character variable of length 1?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 13:36:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468044#M119511</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-06T13:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468045#M119512</link>
      <description>&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;Actually, I have to do a genetic analysis where protocol suggests that missing values should be converted into -9&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 13:37:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468045#M119512</guid>
      <dc:creator>mehul4frnds</dc:creator>
      <dc:date>2018-06-06T13:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468046#M119513</link>
      <description>&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, first I have to change the format in to 2 characters then only i can add missing&amp;nbsp;value data&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 13:39:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468046#M119513</guid>
      <dc:creator>mehul4frnds</dc:creator>
      <dc:date>2018-06-06T13:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468048#M119514</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/201997"&gt;@mehul4frnds&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for the reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, first I have to change the format in to 2 characters then only i can add missing&amp;nbsp;value data&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Changing the format won't do it. You need to create a new variable to replace the old one.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 13:40:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468048#M119514</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-06T13:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468050#M119515</link>
      <description>&lt;P&gt;Thanks.&amp;nbsp;I agree with you that a new variable needs to be created.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly suggest about overall conversion&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 13:43:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468050#M119515</guid>
      <dc:creator>mehul4frnds</dc:creator>
      <dc:date>2018-06-06T13:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468053#M119517</link>
      <description>&lt;P&gt;Retrieve variable attributes from dictionary.columns or sashelp.vcolumn, and create a data step from that with call execute.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 13:51:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468053#M119517</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-06T13:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468059#M119518</link>
      <description>&lt;P&gt;I quite agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;, it makes no sense to convert missings to -9, let alone changing character string to -9.&amp;nbsp; I mean, really no sense at all for characters.&amp;nbsp; For numerics, its possible that the stato has planned that, however I would question it and get specific confirmation.&amp;nbsp; Now if it really is just numbers, then maybe:&lt;/P&gt;
&lt;PRE&gt;options missing=-9;
&lt;/PRE&gt;
&lt;P&gt;Will work for you, if not:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  array n{*} _numeric_;
  do i=1 to dim(n);
    if n=. then n=-9;
  end;
run;&lt;/PRE&gt;
&lt;P&gt;As for character, its not worth providing code, is a more complex process for something which doesn't make any sense.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 14:04:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468059#M119518</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-06T14:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468060#M119519</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;'s great intuition of variable with length 1 byte is something you need a new assignment aka copy the values to the new variable assigned with a higher length and the rest is a breeze&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input id name$ gen$ PROCHI DATE TC HDL LDL Ttg;
datalines;
1   ram      male      1   1.1   8.0   3.0   1.45    1
2   mohan male      1   1.1   8.5   2.9   1.24     .
3   shyam   .           2   2.1   6.8   3.1    2.23    2 
4   radha   female   2   2.1   7.2   3.8    3.80    .
5   gita      female   2   2.1    .      2.7    3.45    3
6   sita       .            2   3.1    8.9  6.8    4.56    2
7   ranu     female  3    2.1   7.5   5.9    1.83   5
8   tina      female   3   2.1   3.6   2.8    1.23   8
9   shan    male      4   8.1   2.8   1.1    1.67   9 
;
run;


data want;
set have;
array c(*) _character_ ;
array num _numeric_;
do _n_=1 to dim(c);
if missing(c(_n_)) then c(_n_)=left(-9);
end;
do _n_=1 to dim(num);
if missing(num(_n_)) then num(_n_)=-9;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Jun 2018 14:06:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468060#M119519</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-06-06T14:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468068#M119523</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;so much for the reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;'s suggestion and your codes work very well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 14:28:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468068#M119523</guid>
      <dc:creator>mehul4frnds</dc:creator>
      <dc:date>2018-06-06T14:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468069#M119524</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/201997"&gt;@mehul4frnds&lt;/a&gt;&amp;nbsp;You are welcome. I am glad!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 14:30:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468069#M119524</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-06-06T14:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468094#M119535</link>
      <description>&lt;P&gt;Another way is to read the data as desired in the first case:&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
invalue $nomiss
' ','.'='-9'
other=_same_;
invalue nomiss
' ','.'=-9
other=_same_;
run;

data have;
length name $ 10 gen $ 6;

informat id nomiss. name $nomiss. gen $nomiss. PROCHI DATE TC HDL LDL Ttg nomiss.;
input id name$ gen$ PROCHI DATE TC HDL LDL Ttg;
datalines;
1   ram   male    1   1.1   8.0   3.0   1.45   1
2   mohan male    1   1.1   8.5   2.9   1.24   .
3   shyam .       2   2.1   6.8   3.1   2.23   2 
4   radha female  2   2.1   7.2   3.8   3.80   .
5   gita  female  2   2.1   .     2.7   3.45   3
6   sita  .       2   3.1   8.9   6.8   4.56   2
7   ranu  female  3   2.1   7.5   5.9   1.83   5
8   tina  female  3   2.1   3.6   2.8   1.23   8
9   shan  male    4   8.1   2.8   1.1   1.67   9 
;
run;&lt;/PRE&gt;
&lt;P&gt;This requires a little more from you to set the lengths of the string variables with either a Length or Attrib statement to prevent the character informat from setting the length to 2. I did not attempt to set a default length for the $nomiss informat as I have no idea what range of values you might be attempting to read.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 15:07:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-Missing-values/m-p/468094#M119535</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-06-06T15:07:28Z</dc:date>
    </item>
  </channel>
</rss>

