<?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: Issue %sysfunc(sql in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Issue-sysfunc-sql/m-p/949599#M42669</link>
    <description>&lt;P&gt;%sysfunc is designed to make data step functions available to the macro language.&lt;/P&gt;
&lt;P&gt;As such %syfucnt expects to see as the first element the name of a function which would typically have a () around the parameters the function uses.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%sysfunc (somefunctionname(&amp;lt;parameter list for the function goes here&amp;gt;) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your syntax has SAS thinking there should be an open parenthesis character, (, immediately after SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure that SQL qualifies as a FUNCTION. I think you may want something more like:&lt;/P&gt;
&lt;PRE&gt;proc sql noprint;
   SELECT count(warning_ind) into : Result_of_sys_check
   FROM work.warning_check 
   WHERE warning_ind = 1
;
quit;
&lt;/PRE&gt;
&lt;P&gt;The INTO : writes the result of the Count function into a macro variable named Result_of_sys_check.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 31 Oct 2024 16:17:06 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2024-10-31T16:17:06Z</dc:date>
    <item>
      <title>Issue %sysfunc(sql</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Issue-sysfunc-sql/m-p/949596#M42668</link>
      <description>&lt;P&gt;Hello,&amp;nbsp; I`` trying to make it so a second query will only start depending on the result of a second query using %sysfunc macro.&lt;BR /&gt;I'm getting an error message saying a parenthesis is required, but there is one so I do not understands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using SAS Enterprise Guide Version 8.2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a copy of the log:&lt;BR /&gt;184&lt;BR /&gt;185 %let Result_of_sys_check = %sysfunc(sql, SELECT count(warning_ind) FROM work.warning_check WHERE warning_ind = 1);&lt;BR /&gt;ERROR: Expected open parenthesis after macro function name not found.&lt;BR /&gt;186 %if &amp;amp;Result_of_sys_check &amp;gt; 0 %then %do;&lt;BR /&gt;ERROR: Required operator not found in expression: SELECT count(warning_ind) FROM work.warning_check WHERE warning_ind = 1) &amp;gt; 0&lt;BR /&gt;ERROR: Skipping to next %END statement.&lt;BR /&gt;187&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 15:31:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Issue-sysfunc-sql/m-p/949596#M42668</guid>
      <dc:creator>learning_one</dc:creator>
      <dc:date>2024-10-31T15:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: Issue %sysfunc(sql</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Issue-sysfunc-sql/m-p/949599#M42669</link>
      <description>&lt;P&gt;%sysfunc is designed to make data step functions available to the macro language.&lt;/P&gt;
&lt;P&gt;As such %syfucnt expects to see as the first element the name of a function which would typically have a () around the parameters the function uses.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%sysfunc (somefunctionname(&amp;lt;parameter list for the function goes here&amp;gt;) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your syntax has SAS thinking there should be an open parenthesis character, (, immediately after SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure that SQL qualifies as a FUNCTION. I think you may want something more like:&lt;/P&gt;
&lt;PRE&gt;proc sql noprint;
   SELECT count(warning_ind) into : Result_of_sys_check
   FROM work.warning_check 
   WHERE warning_ind = 1
;
quit;
&lt;/PRE&gt;
&lt;P&gt;The INTO : writes the result of the Count function into a macro variable named Result_of_sys_check.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 16:17:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Issue-sysfunc-sql/m-p/949599#M42669</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-10-31T16:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Issue %sysfunc(sql</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Issue-sysfunc-sql/m-p/949638#M42674</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 18:15:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Issue-sysfunc-sql/m-p/949638#M42674</guid>
      <dc:creator>learning_one</dc:creator>
      <dc:date>2024-10-31T18:15:58Z</dc:date>
    </item>
  </channel>
</rss>

