<?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: syntax check for the if expression in SAS language in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/syntax-check-for-the-if-expression-in-SAS-language/m-p/78625#M17001</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, it's a solution. However, it's not the best one.&lt;/P&gt;&lt;P&gt;For example, the 'like' operator is legal in where statement but is illegal in an IF statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Apr 2012 06:33:52 GMT</pubDate>
    <dc:creator>VictorJiang</dc:creator>
    <dc:date>2012-04-12T06:33:52Z</dc:date>
    <item>
      <title>syntax check for the if expression in SAS language</title>
      <link>https://communities.sas.com/t5/SAS-Programming/syntax-check-for-the-if-expression-in-SAS-language/m-p/78623#M16999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm writing a Java client to accept an SAS expression , validate it and passed it to the backend SAS macro as the if expression in SAS language.&amp;nbsp; The entered expression will be used as 'if expression' .&amp;nbsp; I want to validate the syntax&amp;nbsp; before pass it to the backend. Is there any approach to syntax check it ?&amp;nbsp;&amp;nbsp; It seems that it's not easy to syntax check it with regular expression as the&amp;nbsp; if expression in SAS language may be very complicated. &lt;/P&gt;&lt;P&gt;If we want to check the syntax of a where clause in SAS language, SAS/FSP data modeler and SCL could be used.&amp;nbsp;&amp;nbsp; Is there a similar approach for the if expression?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;Thanks a lot!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 03:05:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/syntax-check-for-the-if-expression-in-SAS-language/m-p/78623#M16999</guid>
      <dc:creator>VictorJiang</dc:creator>
      <dc:date>2012-04-11T03:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: syntax check for the if expression in SAS language</title>
      <link>https://communities.sas.com/t5/SAS-Programming/syntax-check-for-the-if-expression-in-SAS-language/m-p/78624#M17000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why not use the WHERE clause syntax check?&lt;/P&gt;&lt;P&gt;What you want to test is the expression. In general anything allowed in a WHERE statement is allowed in an IF statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 04:57:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/syntax-check-for-the-if-expression-in-SAS-language/m-p/78624#M17000</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-04-11T04:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: syntax check for the if expression in SAS language</title>
      <link>https://communities.sas.com/t5/SAS-Programming/syntax-check-for-the-if-expression-in-SAS-language/m-p/78625#M17001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, it's a solution. However, it's not the best one.&lt;/P&gt;&lt;P&gt;For example, the 'like' operator is legal in where statement but is illegal in an IF statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 06:33:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/syntax-check-for-the-if-expression-in-SAS-language/m-p/78625#M17001</guid>
      <dc:creator>VictorJiang</dc:creator>
      <dc:date>2012-04-12T06:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: syntax check for the if expression in SAS language</title>
      <link>https://communities.sas.com/t5/SAS-Programming/syntax-check-for-the-if-expression-in-SAS-language/m-p/78626#M17002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am assuming you are talking about a sub-setting IF statement, not any other type?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What about taking a different approach and submit your IF statement to SAS using SYNTAXCHECK mode and/or ERRORABEND to see if it will work OK? You would need to put the IF statement in a DATA step first but you may end up with a more reliable solution as it will pick up other types of errors apart from syntax ones.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 09:37:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/syntax-check-for-the-if-expression-in-SAS-language/m-p/78626#M17002</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2012-04-12T09:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: syntax check for the if expression in SAS language</title>
      <link>https://communities.sas.com/t5/SAS-Programming/syntax-check-for-the-if-expression-in-SAS-language/m-p/78627#M17003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Great idea. Yes, I want to check only the syntax of if-then statements. It's a subset of SAS language.&lt;/P&gt;&lt;P&gt;I will put the if-then statement inot a DATA step step first and then submit it to SAS workspace server and check the returned log.&amp;nbsp; Error will be thronw in the log if there is syntax error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Apr 2012 05:47:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/syntax-check-for-the-if-expression-in-SAS-language/m-p/78627#M17003</guid>
      <dc:creator>VictorJiang</dc:creator>
      <dc:date>2012-04-15T05:47:07Z</dc:date>
    </item>
  </channel>
</rss>

