<?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: Missing data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Missing-data/m-p/725040#M225149</link>
    <description>&lt;P&gt;The story changes depending on the attributes of the variables, so please provide reproducible data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without seeing the data, I can't say exactly what you're seeing.&lt;BR /&gt;Perhaps,&lt;/P&gt;
&lt;P&gt;IF Priorweight2= "." OR Ht_inches= "." THEN BMI= "." ;&lt;/P&gt;
&lt;P&gt;this statement is the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not . which means missing but&amp;nbsp;"." which is string is stored in Priorweight2, Ht_inches, and BMI.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF Priorweight2= . . or Ht_inches= . THEN BMI= . ;&lt;BR /&gt;would improve this point.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Mar 2021 03:34:26 GMT</pubDate>
    <dc:creator>japelin</dc:creator>
    <dc:date>2021-03-10T03:34:26Z</dc:date>
    <item>
      <title>Missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-data/m-p/725034#M225146</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am manipulating my data using the following code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*Convert motherheight to height in inches*/&lt;BR /&gt;DATA LabAnal.study_cohort_2;&lt;BR /&gt;SET LabAnal.study_cohort;&lt;BR /&gt;IF MotherHeight = '' THEN Ht_Inches = .;&lt;BR /&gt;ELSE IF MotherHeight ='?' THEN Ht_Inches ='';&lt;BR /&gt;ELSE Ht_Inches=(INPUT(SUBSTR(MotherHeight, 1, 2), 2.)*12) + (INPUT(SUBSTR(MotherHeight, 4, 2),2.));&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;^^this works great&lt;BR /&gt;&lt;BR /&gt;/*Convert priorweight to a numeric variable*/&lt;BR /&gt;DATA LabAnal.study_cohort_2;&lt;BR /&gt;SET LabAnal.study_cohort;&lt;BR /&gt;Priorweight2 = INPUT(PriorWeight, 3.);&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;^^this also works great&lt;BR /&gt;&lt;BR /&gt;/*Calculate BMI*/&lt;BR /&gt;DATA LabAnal.study_cohort_2;&lt;BR /&gt;SET LabAnal.study_cohort;&lt;BR /&gt;IF Priorweight2= "." or Ht_inches= "." THEN BMI= ".";&lt;BR /&gt;ELSE BMI= (Priorweight2*703)/(Ht_Inches*2);&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;^^but when I run this, it sets all the values from priorweight2, ht_inches and BMI to missing. I've tried with and without quotes around the periods in the IF statement for BMI code. &amp;nbsp;It doesn't change anything.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 03:00:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-data/m-p/725034#M225146</guid>
      <dc:creator>kristiepauly1</dc:creator>
      <dc:date>2021-03-10T03:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-data/m-p/725039#M225148</link>
      <description>&lt;P&gt;As you might have guessed, there are problems with your final step.&amp;nbsp; The main problem is here:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Calculate BMI*/
DATA LabAnal.study_cohort_2;
SET LabAnal.study_cohort;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You are using the wrong data set.&amp;nbsp; This step replaces LabAnal.study_cohort_2, by reading in the data rom LabAnal.study_cohort (which does not contain Priorweight2).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are other, minor issues.&amp;nbsp; For example, to refer to a missing value for a numeric variable, do not use quotes.&amp;nbsp; Change the next line to:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;IF Priorweight2= . or Ht_inches= . THEN BMI= .;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 03:25:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-data/m-p/725039#M225148</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-03-10T03:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-data/m-p/725040#M225149</link>
      <description>&lt;P&gt;The story changes depending on the attributes of the variables, so please provide reproducible data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without seeing the data, I can't say exactly what you're seeing.&lt;BR /&gt;Perhaps,&lt;/P&gt;
&lt;P&gt;IF Priorweight2= "." OR Ht_inches= "." THEN BMI= "." ;&lt;/P&gt;
&lt;P&gt;this statement is the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not . which means missing but&amp;nbsp;"." which is string is stored in Priorweight2, Ht_inches, and BMI.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF Priorweight2= . . or Ht_inches= . THEN BMI= . ;&lt;BR /&gt;would improve this point.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 03:34:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-data/m-p/725040#M225149</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-03-10T03:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-data/m-p/725053#M225156</link>
      <description>&lt;P&gt;I completely overlooked the DATA SET.&amp;nbsp; That was the fix. Thank You!!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 04:09:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-data/m-p/725053#M225156</guid>
      <dc:creator>kristiepauly1</dc:creator>
      <dc:date>2021-03-10T04:09:15Z</dc:date>
    </item>
  </channel>
</rss>

