<?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 If/ Else statement error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/If-Else-statement-error/m-p/329300#M73652</link>
    <description>&lt;P&gt;I have submitted this code but getting an error as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data=work.systems;                                                                                                                      
set=work.carsales;                                                                                                                      
if prxmatch("m/Acura|Dodge|Ford/oi",Manufacturer) &amp;gt; 0 then found=1;                                                                     
else found=0;                                                                                                                           
run; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data=work.systems;&lt;BR /&gt;----&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;81 set=work.carsales;&lt;BR /&gt;---&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;82 if prxmatch("m/Acura|Dodge|Ford/oi",Manufacturer) &amp;gt; 0 then found=1;&lt;BR /&gt;--&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;83 else found=0;&lt;BR /&gt;----&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;84 run;&lt;BR /&gt;85 data=work.systems;&lt;BR /&gt;----&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;86 set=work.carsales;&lt;BR /&gt;---&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently Im using SAS 9.0 so just want to ask "is this due the old SAS version that Im using"?&lt;/P&gt;</description>
    <pubDate>Thu, 02 Feb 2017 05:48:46 GMT</pubDate>
    <dc:creator>bits</dc:creator>
    <dc:date>2017-02-02T05:48:46Z</dc:date>
    <item>
      <title>If/ Else statement error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-Else-statement-error/m-p/329300#M73652</link>
      <description>&lt;P&gt;I have submitted this code but getting an error as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data=work.systems;                                                                                                                      
set=work.carsales;                                                                                                                      
if prxmatch("m/Acura|Dodge|Ford/oi",Manufacturer) &amp;gt; 0 then found=1;                                                                     
else found=0;                                                                                                                           
run; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data=work.systems;&lt;BR /&gt;----&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;81 set=work.carsales;&lt;BR /&gt;---&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;82 if prxmatch("m/Acura|Dodge|Ford/oi",Manufacturer) &amp;gt; 0 then found=1;&lt;BR /&gt;--&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;83 else found=0;&lt;BR /&gt;----&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;84 run;&lt;BR /&gt;85 data=work.systems;&lt;BR /&gt;----&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;86 set=work.carsales;&lt;BR /&gt;---&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently Im using SAS 9.0 so just want to ask "is this due the old SAS version that Im using"?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 05:48:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-Else-statement-error/m-p/329300#M73652</guid>
      <dc:creator>bits</dc:creator>
      <dc:date>2017-02-02T05:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: If/ Else statement error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-Else-statement-error/m-p/329303#M73653</link>
      <description>&lt;P&gt;No. your code has errors. As noted your DATA and SET statements are incorrect, remove the = sign.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I dont know if the PRX is correct but you can reply after fixing those basic errors.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS 9.0 would be 15 years old so I seriously hope that's not the case. &amp;nbsp;And if so, why?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 05:54:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-Else-statement-error/m-p/329303#M73653</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-02T05:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: If/ Else statement error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-Else-statement-error/m-p/329326#M73661</link>
      <description>&lt;P&gt;Just another point, you are doing a binary yes/no if statement, so save yourself a bit of typing and use ifc/ifn functions:&lt;/P&gt;
&lt;PRE&gt;data work.systems;                                                                                                                      
  set work.carsales;                                                                                                                      
  found=ifn(prxmatch("m/Acura|Dodge|Ford/oi",Manufacturer),1,0);                                                                                                                           
run; &lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Feb 2017 09:21:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-Else-statement-error/m-p/329326#M73661</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-02-02T09:21:39Z</dc:date>
    </item>
  </channel>
</rss>

