<?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 -Creating new variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data-Creating-new-variables/m-p/84939#M256922</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check if its missing first and then if its not equal to 8 second.&lt;/P&gt;&lt;P&gt;That seems to be what your code is trying to do.&lt;/P&gt;&lt;P&gt;It's a bit weird to see a less than sign and a not equal to in the same line so I'm not sure what that would be evaluating to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if dg6fqe=. then newvar=.&lt;/P&gt;&lt;P&gt;else if dg6fqe ne 8 then newvar=1;&lt;/P&gt;&lt;P&gt;else newvar=0;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 May 2013 21:56:10 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2013-05-23T21:56:10Z</dc:date>
    <item>
      <title>Missing Data -Creating new variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data-Creating-new-variables/m-p/84935#M256918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am recoding variables and am having trouble with missing data. I was to make sure if data is missing, it stays missing in the new variables so I have coded like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (.&amp;lt;dg6fqad^=8) or (.&amp;lt;dg6fqd^=8) then newvar=1;&lt;/P&gt;&lt;P&gt;if (dg6fqad=.) and (dg6fqd=.) then newvar=.;&lt;/P&gt;&lt;P&gt;else newvar=0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (.&amp;lt;dg6fqe^=8) then newvar1=1; &lt;/P&gt;&lt;P&gt;if dg6fqe=. then newvar1=.; &lt;/P&gt;&lt;P&gt;else newvar1=0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This codes makes missing data =0, how do I correct this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 21:33:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data-Creating-new-variables/m-p/84935#M256918</guid>
      <dc:creator>rfarmenta</dc:creator>
      <dc:date>2013-05-23T21:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Data -Creating new variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data-Creating-new-variables/m-p/84936#M256919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if (.&amp;lt;dg6fqad^=8) or (.&amp;lt;dg6fqd^=8) then newvar=1;&lt;/P&gt;&lt;P&gt;else if (dg6fqad=.) and (dg6fqd=.) then newvar=.;&lt;/P&gt;&lt;P&gt;else newvar=0;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 21:39:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data-Creating-new-variables/m-p/84936#M256919</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-05-23T21:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Data -Creating new variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data-Creating-new-variables/m-p/84937#M256920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was dumb of me, I didn't even think that all it needed was to add else. Thank you! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 21:42:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data-Creating-new-variables/m-p/84937#M256920</guid>
      <dc:creator>rfarmenta</dc:creator>
      <dc:date>2013-05-23T21:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Data -Creating new variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data-Creating-new-variables/m-p/84938#M256921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, for this, the missing variables are still getting coded wrong, is there something else I need to do? I am sure it is simple but I keep getting it wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if .&amp;lt;dg6fqe^=8 then newvar=1; &lt;/P&gt;&lt;P&gt;else if dg6fqe=. then newvar=.; &lt;/P&gt;&lt;P&gt;else newvar=0 ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 21:53:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data-Creating-new-variables/m-p/84938#M256921</guid>
      <dc:creator>rfarmenta</dc:creator>
      <dc:date>2013-05-23T21:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Data -Creating new variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data-Creating-new-variables/m-p/84939#M256922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check if its missing first and then if its not equal to 8 second.&lt;/P&gt;&lt;P&gt;That seems to be what your code is trying to do.&lt;/P&gt;&lt;P&gt;It's a bit weird to see a less than sign and a not equal to in the same line so I'm not sure what that would be evaluating to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if dg6fqe=. then newvar=.&lt;/P&gt;&lt;P&gt;else if dg6fqe ne 8 then newvar=1;&lt;/P&gt;&lt;P&gt;else newvar=0;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 21:56:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data-Creating-new-variables/m-p/84939#M256922</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-05-23T21:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Data -Creating new variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data-Creating-new-variables/m-p/84940#M256923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hm, ok that makes sense and I see why that coding is better than mine but it is still not working. I have 79 missing values and should have 62 in my 0 category but it is giving me a 0=141 and no missing. I can't figure out what is going on. Thanks for your input. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 22:13:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data-Creating-new-variables/m-p/84940#M256923</guid>
      <dc:creator>rfarmenta</dc:creator>
      <dc:date>2013-05-23T22:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Data -Creating new variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data-Creating-new-variables/m-p/84941#M256924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sometimes instead of trying to get all of several multiple variable logics to work and exclude at each step I go through the main logic. Then add:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if dg6fqe=. then newvar=. ;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;After&lt;/STRONG&gt; the main assignments. It may not be elegant but it easy to understand and maintain.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 22:29:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data-Creating-new-variables/m-p/84941#M256924</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-05-23T22:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Data -Creating new variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data-Creating-new-variables/m-p/84942#M256925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;run a proc freq on the new/old var to see where isn't coding correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=have;&lt;/P&gt;&lt;P&gt;table dg6fqe*newvar/missing;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 22:30:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data-Creating-new-variables/m-p/84942#M256925</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-05-23T22:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Data -Creating new variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data-Creating-new-variables/m-p/84943#M256926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just figured it out, for some reason I had two instances of the code in the data step. The second coding was incorrect and lumping the missing in with the 0 category and was overriding the first, correct coding. Dumb oversight on my part, thank you for your help and patience! I appreciate it! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 22:40:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data-Creating-new-variables/m-p/84943#M256926</guid>
      <dc:creator>rfarmenta</dc:creator>
      <dc:date>2013-05-23T22:40:05Z</dc:date>
    </item>
  </channel>
</rss>

