<?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: SAS coding problem in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-coding-problem/m-p/343038#M78695</link>
    <description>&lt;P&gt;Post your code directly into the forum using a code block please.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think it's a logical error - your data is meeting a classification in a IF statement before the IF statement you're trying to assign.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF statements are evaluated in order, and if one is evaluated as TRUE then it exits the IF block.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Verify your logic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need further help, please post some sample data - ideally records from your data that you know should work but aren't and include the code/log and output you expect vs what you get.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Mar 2017 19:21:12 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-03-21T19:21:12Z</dc:date>
    <item>
      <title>SAS coding problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-coding-problem/m-p/343034#M78691</link>
      <description>&lt;P&gt;I am having trouble with my sas code, specifically with this line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;else if substr(major1,1,6) in ('422704','422801') and degree_level='D' then isSTEMH1='Y'; The full data step code is in the attached word document.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know for a fact that there are records with these CIP codes and it is not classifying them correctly when i run the full data step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2017 19:09:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-coding-problem/m-p/343034#M78691</guid>
      <dc:creator>Candrews</dc:creator>
      <dc:date>2017-03-21T19:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: SAS coding problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-coding-problem/m-p/343036#M78693</link>
      <description>&lt;P&gt;Can you provide some sample data? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also it is easier for us if you post your code directly using the running guy at the top&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2017 19:16:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-coding-problem/m-p/343036#M78693</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-03-21T19:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: SAS coding problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-coding-problem/m-p/343038#M78695</link>
      <description>&lt;P&gt;Post your code directly into the forum using a code block please.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think it's a logical error - your data is meeting a classification in a IF statement before the IF statement you're trying to assign.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF statements are evaluated in order, and if one is evaluated as TRUE then it exits the IF block.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Verify your logic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need further help, please post some sample data - ideally records from your data that you know should work but aren't and include the code/log and output you expect vs what you get.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2017 19:21:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-coding-problem/m-p/343038#M78695</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-21T19:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: SAS coding problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-coding-problem/m-p/343043#M78699</link>
      <description>&lt;P&gt;I tried moving the if statement to the beginning of the data step and still no luck. I will try to post a sample data set.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2017 19:33:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-coding-problem/m-p/343043#M78699</guid>
      <dc:creator>Candrews</dc:creator>
      <dc:date>2017-03-21T19:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: SAS coding problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-coding-problem/m-p/343069#M78715</link>
      <description>&lt;P&gt;Reeza is right, there are few problems with your IFstatement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, you are evaluating string '13120601' three times:&lt;/P&gt;
&lt;P&gt;- in the very first IF, in conjunction with fice and academic_year,&lt;/P&gt;
&lt;P&gt;- then few ELSE IFs later - just '13120601';&lt;/P&gt;
&lt;P&gt;- and in the next line - first six characters of it - '131206'&amp;nbsp;and&amp;nbsp;fice='00200200'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would really be&amp;nbsp;helpful to know what question are you trying to answer? Do you need to know three things - first major was STEM-H, second major was STEM-H, any of the majors was STEM-H? Or just one - any of the majors was STEM-H?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2017 20:39:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-coding-problem/m-p/343069#M78715</guid>
      <dc:creator>Marina</dc:creator>
      <dc:date>2017-03-21T20:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS coding problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-coding-problem/m-p/343070#M78716</link>
      <description>&lt;P&gt;I'm betting on something simple and obvious like degree_level is actually "d" rather than "D"&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2017 20:53:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-coding-problem/m-p/343070#M78716</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-03-21T20:53:02Z</dc:date>
    </item>
  </channel>
</rss>

