<?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 solve question - based on creating a new variable on basis of 6 existing variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/solve-question-based-on-creating-a-new-variable-on-basis-of-6/m-p/444456#M111282</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I dont have any data but i have to give a sample code for how i would solve such a problem.&lt;/P&gt;&lt;P&gt;the problem is to Create a variable&amp;nbsp;decision_pt&amp;nbsp; that sums the occurences of the following&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;OL&gt;&lt;LI&gt;age&amp;nbsp;&amp;lt;&amp;nbsp;45&lt;/LI&gt;&lt;LI&gt;state&amp;nbsp;is “URBAN” or “HIGHLY URBAN”&lt;/LI&gt;&lt;LI&gt;furniture&amp;nbsp;&amp;gt;=&amp;nbsp;5&lt;/LI&gt;&lt;LI&gt;premium = yes&lt;/LI&gt;&lt;LI&gt;usage&amp;nbsp;= “COMMERCIAL”&lt;/LI&gt;&lt;LI&gt;male&amp;nbsp;= 1&lt;/LI&gt;&lt;/OL&gt;&lt;/OL&gt;&lt;PRE&gt;data a;
set a;
retain &lt;SPAN&gt;decision_pt&lt;/SPAN&gt; = 0;
if age &amp;lt; 45 then &lt;SPAN&gt;decision_pt&lt;/SPAN&gt; =&lt;SPAN&gt;decision_pt&lt;/SPAN&gt; +1 ;
if state ="URBAN" or "HIGHLY URBAN" &lt;SPAN&gt;decision_pt&lt;/SPAN&gt; =&lt;SPAN&gt;decision_pt&lt;/SPAN&gt; +1 ;&lt;/PRE&gt;&lt;P&gt;am i on the right track?&lt;/P&gt;</description>
    <pubDate>Sat, 10 Mar 2018 21:02:48 GMT</pubDate>
    <dc:creator>TiaK</dc:creator>
    <dc:date>2018-03-10T21:02:48Z</dc:date>
    <item>
      <title>solve question - based on creating a new variable on basis of 6 existing variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/solve-question-based-on-creating-a-new-variable-on-basis-of-6/m-p/444456#M111282</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I dont have any data but i have to give a sample code for how i would solve such a problem.&lt;/P&gt;&lt;P&gt;the problem is to Create a variable&amp;nbsp;decision_pt&amp;nbsp; that sums the occurences of the following&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;OL&gt;&lt;LI&gt;age&amp;nbsp;&amp;lt;&amp;nbsp;45&lt;/LI&gt;&lt;LI&gt;state&amp;nbsp;is “URBAN” or “HIGHLY URBAN”&lt;/LI&gt;&lt;LI&gt;furniture&amp;nbsp;&amp;gt;=&amp;nbsp;5&lt;/LI&gt;&lt;LI&gt;premium = yes&lt;/LI&gt;&lt;LI&gt;usage&amp;nbsp;= “COMMERCIAL”&lt;/LI&gt;&lt;LI&gt;male&amp;nbsp;= 1&lt;/LI&gt;&lt;/OL&gt;&lt;/OL&gt;&lt;PRE&gt;data a;
set a;
retain &lt;SPAN&gt;decision_pt&lt;/SPAN&gt; = 0;
if age &amp;lt; 45 then &lt;SPAN&gt;decision_pt&lt;/SPAN&gt; =&lt;SPAN&gt;decision_pt&lt;/SPAN&gt; +1 ;
if state ="URBAN" or "HIGHLY URBAN" &lt;SPAN&gt;decision_pt&lt;/SPAN&gt; =&lt;SPAN&gt;decision_pt&lt;/SPAN&gt; +1 ;&lt;/PRE&gt;&lt;P&gt;am i on the right track?&lt;/P&gt;</description>
      <pubDate>Sat, 10 Mar 2018 21:02:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/solve-question-based-on-creating-a-new-variable-on-basis-of-6/m-p/444456#M111282</guid>
      <dc:creator>TiaK</dc:creator>
      <dc:date>2018-03-10T21:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: solve question - based on creating a new variable on basis of 6 existing variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/solve-question-based-on-creating-a-new-variable-on-basis-of-6/m-p/444457#M111283</link>
      <description>&lt;P&gt;You can't expect us here in SAS Communities to do your homework for you! You will not learn anything that way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So here's my suggestion: you write some SAS code to do this, and if you can't get it to work, show us the code and the SASLOG, and someone here will know how to fix it.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Mar 2018 20:52:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/solve-question-based-on-creating-a-new-variable-on-basis-of-6/m-p/444457#M111283</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-03-10T20:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: solve question - based on creating a new variable on basis of 6 existing variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/solve-question-based-on-creating-a-new-variable-on-basis-of-6/m-p/444461#M111287</link>
      <description>&lt;P&gt;i modified the question with my answer now. hope this helps.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Mar 2018 21:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/solve-question-based-on-creating-a-new-variable-on-basis-of-6/m-p/444461#M111287</guid>
      <dc:creator>TiaK</dc:creator>
      <dc:date>2018-03-10T21:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: solve question - based on creating a new variable on basis of 6 existing variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/solve-question-based-on-creating-a-new-variable-on-basis-of-6/m-p/444462#M111288</link>
      <description>&lt;P&gt;Seems like this could produce the desired answer, once you clean up your syntax errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if state ="URBAN" or state="HIGHLY URBAN" then decision_pt =decision_pt +1 ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Mar 2018 21:09:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/solve-question-based-on-creating-a-new-variable-on-basis-of-6/m-p/444462#M111288</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-03-10T21:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: solve question - based on creating a new variable on basis of 6 existing variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/solve-question-based-on-creating-a-new-variable-on-basis-of-6/m-p/444540#M111319</link>
      <description>&lt;P&gt;Is adding retain important here?&lt;/P&gt;</description>
      <pubDate>Sun, 11 Mar 2018 11:23:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/solve-question-based-on-creating-a-new-variable-on-basis-of-6/m-p/444540#M111319</guid>
      <dc:creator>TiaK</dc:creator>
      <dc:date>2018-03-11T11:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: solve question - based on creating a new variable on basis of 6 existing variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/solve-question-based-on-creating-a-new-variable-on-basis-of-6/m-p/444569#M111326</link>
      <description>&lt;P&gt;RETAIN probably isn't needed here, and may have undesired effects.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;decision_pt=0;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Mar 2018 18:10:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/solve-question-based-on-creating-a-new-variable-on-basis-of-6/m-p/444569#M111326</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-03-11T18:10:09Z</dc:date>
    </item>
  </channel>
</rss>

