<?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: how to use IF-Then in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/how-to-use-IF-Then/m-p/96433#M27235</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) Look at where you end statements are.&lt;/P&gt;&lt;P&gt;2) Take a look at the condition that makes you enter the loop, first do&lt;/P&gt;&lt;P&gt;and then the lines after that. Those conditions will never be true.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest getting the code working for one variable then moving on to implementing with an array.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Dec 2012 15:30:33 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2012-12-11T15:30:33Z</dc:date>
    <item>
      <title>how to use IF-Then</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-use-IF-Then/m-p/96432#M27234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dataset that I'd like to recode as followings:&lt;/P&gt;&lt;P&gt;recode the variables with the smallest value of 0.000623175 to polytomous items with 4 scores (0,1,2,3)&lt;/P&gt;&lt;P&gt;recode the variables with the smallest value of 0.001041523 to polytomous items with 3 scores (0,1,2)&lt;/P&gt;&lt;P&gt;and recode the variables with the smallest value o f0.002864969 to polytomous items with dichotomous.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code doesn't work:&lt;/P&gt;&lt;P&gt;data coded (drop=score1-score116 i);&lt;/P&gt;&lt;P&gt;set itemsc;&lt;/P&gt;&lt;P&gt;array score (116) score1-score116;&lt;/P&gt;&lt;P&gt;array f_item(116);&lt;/P&gt;&lt;P&gt;array t_item(116);&lt;/P&gt;&lt;P&gt;array d_item(116);&lt;/P&gt;&lt;P&gt;do i=1 to 116;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if score{i} lt 0.000623175 then DO;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if score{i} lt 0.000623175 then f_item{i}=3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if score{i} lt 0.002864969 then f_item{i}=2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if score{i} lt 0.013617708 then f_item{i}=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if score{i} le 0.431834293 then f_item{i}=0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if score{i} lt 0.001041523 then do;&lt;/P&gt;&lt;P&gt;if score{i} lt 0.001041523 then t_item{i}=2;&lt;/P&gt;&lt;P&gt;else if score{i} lt 0.008116862 then t_item{i}=1;&lt;/P&gt;&lt;P&gt;else if score{i} le 0.431834293 then t_item{i}=0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if score{i} lt 0.002864969 then d_item{i}=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if score{i} le 0.431834293 then d_item{i}=0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 15:21:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-use-IF-Then/m-p/96432#M27234</guid>
      <dc:creator>R_A_G_</dc:creator>
      <dc:date>2012-12-11T15:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to use IF-Then</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-use-IF-Then/m-p/96433#M27235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) Look at where you end statements are.&lt;/P&gt;&lt;P&gt;2) Take a look at the condition that makes you enter the loop, first do&lt;/P&gt;&lt;P&gt;and then the lines after that. Those conditions will never be true.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest getting the code working for one variable then moving on to implementing with an array.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 15:30:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-use-IF-Then/m-p/96433#M27235</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-12-11T15:30:33Z</dc:date>
    </item>
  </channel>
</rss>

