<?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: Missover is not giving exact answer` in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Missover-is-not-giving-exact-answer/m-p/263462#M51555</link>
    <description>&lt;P&gt;This is a well covered topic if you search here or the Internet.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/What-is-the-difference-between-Missover-and-Truncover/td-p/31888" target="_blank"&gt;https://communities.sas.com/t5/Base-SAS-Programming/What-is-the-difference-between-Missover-and-Truncover/td-p/31888&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If if your data doesn't have specific delimiters besides a space your going to have a hard time reading in your file.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Apr 2016 10:00:19 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-04-13T10:00:19Z</dc:date>
    <item>
      <title>Missover is not giving exact answer`</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missover-is-not-giving-exact-answer/m-p/263447#M51552</link>
      <description>&lt;P&gt;&lt;BR /&gt;data sid8;&lt;BR /&gt;infile datalines missover;&lt;BR /&gt;input name $ sex $ age city $ company $ ;&lt;BR /&gt;datalines;&lt;BR /&gt;Rahul 22 Banglore TCS&lt;BR /&gt;Mahesh M 26 Mumbai AXIS&lt;BR /&gt;Kiran 24 Pune CYTEL&lt;BR /&gt;swati F 26 Mumbai KOTAK&lt;BR /&gt;Mahesh M 23 Mumbai AXIS&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is not assigning missing valuea as blank &amp;nbsp;to variable sex&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 09:31:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missover-is-not-giving-exact-answer/m-p/263447#M51552</guid>
      <dc:creator>sidgkwd42</dc:creator>
      <dc:date>2016-04-13T09:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Missover is not giving exact answer`</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missover-is-not-giving-exact-answer/m-p/263458#M51553</link>
      <description>&lt;P&gt;That's not how missover works, especially since you don't have delimiter to identify missing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS really can't know that 22 isn't a valid sex.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 09:54:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missover-is-not-giving-exact-answer/m-p/263458#M51553</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-13T09:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Missover is not giving exact answer`</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missover-is-not-giving-exact-answer/m-p/263459#M51554</link>
      <description>&lt;P&gt;Then what is exact use of missover and how to use&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 09:56:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missover-is-not-giving-exact-answer/m-p/263459#M51554</guid>
      <dc:creator>sidgkwd42</dc:creator>
      <dc:date>2016-04-13T09:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: Missover is not giving exact answer`</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missover-is-not-giving-exact-answer/m-p/263462#M51555</link>
      <description>&lt;P&gt;This is a well covered topic if you search here or the Internet.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/What-is-the-difference-between-Missover-and-Truncover/td-p/31888" target="_blank"&gt;https://communities.sas.com/t5/Base-SAS-Programming/What-is-the-difference-between-Missover-and-Truncover/td-p/31888&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If if your data doesn't have specific delimiters besides a space your going to have a hard time reading in your file.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 10:00:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missover-is-not-giving-exact-answer/m-p/263462#M51555</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-13T10:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Missover is not giving exact answer`</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missover-is-not-giving-exact-answer/m-p/263465#M51557</link>
      <description>&lt;P&gt;it is hard to believe you don't have at least 2 consecutive delimiters between your variables in case, for example, sex is missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if the case adding &lt;STRONG&gt;dsd delimiter=' '; &lt;/STRONG&gt;to your infile statement will do it.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 10:12:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missover-is-not-giving-exact-answer/m-p/263465#M51557</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2016-04-13T10:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: Missover is not giving exact answer`</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missover-is-not-giving-exact-answer/m-p/263467#M51558</link>
      <description>&lt;P&gt;You would need to do this yourself. &amp;nbsp;There is no logical way to identify "2" as sex anymore than "M" or "F". &amp;nbsp;Consider using delimited data in future.&lt;/P&gt;
&lt;P&gt;Post process example:&lt;/P&gt;
&lt;PRE&gt;data sid8 (keep=name sex age city company);
  length name sex age city company str $40;
  infile datalines dlm="¬";
  input str $;
  name=scan(str,1," ");
  next=2;
  if scan(str,2," ") in ("M","F") then do;
    sex=scan(str,2," ");
    next=3;
  end;
  age=scan(str,next," ");
  next=next+1;
  city=scan(str,next," ");
  next=next+1;
  company=scan(str,next," ");
datalines;
Rahul 22 Banglore TCS
Mahesh M 26 Mumbai AXIS
Kiran 24 Pune CYTEL
swati F 26 Mumbai KOTAK
Mahesh M 23 Mumbai AXIS
;
run;
&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Apr 2016 10:17:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missover-is-not-giving-exact-answer/m-p/263467#M51558</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-04-13T10:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Missover is not giving exact answer`</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missover-is-not-giving-exact-answer/m-p/263543#M51587</link>
      <description>&lt;P&gt;What do you want the values of your other variables to be when "missing" the sex value?&lt;/P&gt;
&lt;P&gt;Your current code gets missing values of age because it reads the city and city has the value of company.&lt;/P&gt;
&lt;P&gt;If you actually have a lot of data of this poor quality you are going to have to parse the input string and treat the case of missing sex differently.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sid8;
   infile datalines missover;
   input @ ;
   if upcase(scan(_infile_,2)) in ('M','F') then input name $ sex $ age city $ company $ ;
   else input name $  age city $ company ;
   datalines;
   Rahul 22 Banglore TCS
   Mahesh M 26 Mumbai AXIS
   Kiran 24 Pune CYTEL
   swati F 26 Mumbai KOTAK
   Mahesh M 23 Mumbai AXIS
   ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However it would be much preferabl to get the data layout in a better form such as suggested by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/33792"&gt;@Loko﻿&lt;/a&gt;&amp;nbsp;or &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9﻿&lt;/a&gt;as the number of exceptions are likely to increase such&amp;nbsp;imbedded spaces in names of people, cities&amp;nbsp;or companies and varying number of name parts for people.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 14:55:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missover-is-not-giving-exact-answer/m-p/263543#M51587</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-04-13T14:55:39Z</dc:date>
    </item>
  </channel>
</rss>

