<?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: Craeting a new variable- code issue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Craeting-a-new-variable-code-issue/m-p/124173#M260007</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think if you look closely that if dgeverc =1, or any other non-zero and non-missing value, and dgevere is missing then you do not address that case. So Oldvar=., dgeverc=1 and dgevere=. has newvar_6m not assigned. Are those what your a seeing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Aug 2013 19:43:54 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2013-08-28T19:43:54Z</dc:date>
    <item>
      <title>Craeting a new variable- code issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Craeting-a-new-variable-code-issue/m-p/124171#M260005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I trying to fill in missing data in a dataset based on skip patterns and other variables but it does not seem to be doing what I want it to. I am not sure if there is a problem with my logic or the code and would appreciate some help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code I have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;newvar_6m=.;&lt;/P&gt;&lt;P&gt;if oldvar=1 then newvar_6m=1;&lt;/P&gt;&lt;P&gt;else if oldvar=0 then newvar_6m=0;&lt;/P&gt;&lt;P&gt;else if dgeverc=0 then newvar_6m=0;&lt;/P&gt;&lt;P&gt;else if dgevere=0 then newvar_6m=0;&lt;/P&gt;&lt;P&gt;else if (dgeverc=.) and (dgevere=.) then newvar_6m=.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The oldvar has 91 missing based on skip patterns because if participans answered no to previous questions then they skipped this question. However, I know that if they said no to previous questions, then the oldvar should also be no so&amp;nbsp; I created code to fill in the missing and create newvar_6m.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the variable dgeverc has 0 missing, and dgevere has 44 missing. I figured the code above would fill in the missing for newvar_6m so it had no missing since all missing should be recoded to 0, what did I do wrong? I am sure it is a dumb mistake I am not picking up on so any suggestions would be appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 17:17:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Craeting-a-new-variable-code-issue/m-p/124171#M260005</guid>
      <dc:creator>rfarmenta</dc:creator>
      <dc:date>2013-08-28T17:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: Craeting a new variable- code issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Craeting-a-new-variable-code-issue/m-p/124172#M260006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Run a proc freq on your data and examine the output (and post back if you still don't understand).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't see anything wrong with the code, so either your if/else statements are off or the data isn't what you think.&amp;nbsp; Hard to tell without seeing any data or the log.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=have;&lt;/P&gt;&lt;P&gt;table oldvar*dgverc*dgevere/out=summary1 list;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 17:39:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Craeting-a-new-variable-code-issue/m-p/124172#M260006</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-08-28T17:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: Craeting a new variable- code issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Craeting-a-new-variable-code-issue/m-p/124173#M260007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think if you look closely that if dgeverc =1, or any other non-zero and non-missing value, and dgevere is missing then you do not address that case. So Oldvar=., dgeverc=1 and dgevere=. has newvar_6m not assigned. Are those what your a seeing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 19:43:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Craeting-a-new-variable-code-issue/m-p/124173#M260007</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-08-28T19:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Craeting a new variable- code issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Craeting-a-new-variable-code-issue/m-p/124174#M260008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I figured it out, you are correct ballardw, I have a condition that is not met but where I can't fill in the missing. They answered Yes to dgeverc and dgevere but did not answer oldvar so I don't know whether it is yea or no, therefore, I must keep those as missing values. Thank you or your input. I am just glad there was nothing wrong with my code and my logic is ok. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 20:01:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Craeting-a-new-variable-code-issue/m-p/124174#M260008</guid>
      <dc:creator>rfarmenta</dc:creator>
      <dc:date>2013-08-28T20:01:32Z</dc:date>
    </item>
  </channel>
</rss>

