<?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: Error in macro code in WHERE clause in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Error-in-macro-code-in-WHERE-clause/m-p/445591#M69418</link>
    <description>&lt;P&gt;Does the non macro version work as expected?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	data _null_;
    set cpdvars;
	where (CPDCOBRS_GRP_T='CTL_log_sfix'
		and CPDCOBRS_VAR_NM=19);
	call symputx('return_value',CPDCOBRS_RTRN_VLU_1);
	run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 14 Mar 2018 19:07:53 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-03-14T19:07:53Z</dc:date>
    <item>
      <title>Error in macro code in WHERE clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-in-macro-code-in-WHERE-clause/m-p/445584#M69416</link>
      <description>&lt;P&gt;Error for attached program when running in UNIX:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: Line generated by the invoked macro "LOADCPDFIX".&lt;BR /&gt;19020 data _null_; set cpdvars; where (CPDCOBRS_GRP_T=&amp;amp;fixcpd and CPDCOBRS_VAR_NM=&amp;amp;var_nm); call&lt;BR /&gt;_______________&lt;BR /&gt;22&lt;BR /&gt;76&lt;BR /&gt;19020 ! symput('return_value',CPDCOBRS_RTRN_VLU_1); run;&lt;BR /&gt;ERROR: Syntax error while parsing WHERE clause.&lt;/P&gt;
&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, (, *, **, +, -, /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, AND, EQ, GE, GT,&lt;BR /&gt;LE, LT, NE, OR, ^=, |, ||, ~=.&lt;/P&gt;
&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;
&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 19:05:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-in-macro-code-in-WHERE-clause/m-p/445584#M69416</guid>
      <dc:creator>sai99</dc:creator>
      <dc:date>2018-03-14T19:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Macros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-in-macro-code-in-WHERE-clause/m-p/445590#M69417</link>
      <description>&lt;P&gt;I don't see anything jumpling out at me...not that there isn't anything, but why are you doing this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let fixcpd=&amp;amp;Grouping_Criteria;
%let var_nm=&amp;amp;Var_name;
%let return_value=;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That doesn't add a lot of value to your code, except making it harder to trace and debug.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It may help if you include the full log - we can't run the code because we don't have the data. Maybe it's a data issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/195023"&gt;@sai99&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Error for attached program when running in UNIX:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: Line generated by the invoked macro "LOADCPDFIX".&lt;BR /&gt;19020 data _null_; set cpdvars; where (CPDCOBRS_GRP_T=&amp;amp;fixcpd and CPDCOBRS_VAR_NM=&amp;amp;var_nm); call&lt;BR /&gt;_______________&lt;BR /&gt;22&lt;BR /&gt;76&lt;BR /&gt;19020 ! symput('return_value',CPDCOBRS_RTRN_VLU_1); run;&lt;BR /&gt;ERROR: Syntax error while parsing WHERE clause.&lt;/P&gt;
&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, (, *, **, +, -, /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, AND, EQ, GE, GT,&lt;BR /&gt;LE, LT, NE, OR, ^=, |, ||, ~=.&lt;/P&gt;
&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;
&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 19:04:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-in-macro-code-in-WHERE-clause/m-p/445590#M69417</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-14T19:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Error in macro code in WHERE clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-in-macro-code-in-WHERE-clause/m-p/445591#M69418</link>
      <description>&lt;P&gt;Does the non macro version work as expected?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	data _null_;
    set cpdvars;
	where (CPDCOBRS_GRP_T='CTL_log_sfix'
		and CPDCOBRS_VAR_NM=19);
	call symputx('return_value',CPDCOBRS_RTRN_VLU_1);
	run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Mar 2018 19:07:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-in-macro-code-in-WHERE-clause/m-p/445591#M69418</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-14T19:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Error in macro code in WHERE clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-in-macro-code-in-WHERE-clause/m-p/445599#M69419</link>
      <description>yes data _null_;&lt;BR /&gt;set cpdvars;&lt;BR /&gt;where (CPDCOBRS_GRP_T=19&lt;BR /&gt;and CPDCOBRS_VAR_NM='CTL_log_sfix');&lt;BR /&gt;call symputx('return_value',CPDCOBRS_RTRN_VLU_1);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;works fine</description>
      <pubDate>Wed, 14 Mar 2018 19:15:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-in-macro-code-in-WHERE-clause/m-p/445599#M69419</guid>
      <dc:creator>sai99</dc:creator>
      <dc:date>2018-03-14T19:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Macros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-in-macro-code-in-WHERE-clause/m-p/445602#M69420</link>
      <description>I want to globalize sfixs, pfixs and suffixs but I am trying to avoid using local parametrs as global variables so used different variable names</description>
      <pubDate>Wed, 14 Mar 2018 19:17:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-in-macro-code-in-WHERE-clause/m-p/445602#M69420</guid>
      <dc:creator>sai99</dc:creator>
      <dc:date>2018-03-14T19:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error in macro code in WHERE clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-in-macro-code-in-WHERE-clause/m-p/445605#M69421</link>
      <description>&lt;P&gt;Then you need to post your full log.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/195023"&gt;@sai99&lt;/a&gt; wrote:&lt;BR /&gt;yes data _null_;&lt;BR /&gt;set cpdvars;&lt;BR /&gt;where (CPDCOBRS_GRP_T=19&lt;BR /&gt;and CPDCOBRS_VAR_NM='CTL_log_sfix');&lt;BR /&gt;call symputx('return_value',CPDCOBRS_RTRN_VLU_1);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;works fine&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 19:21:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-in-macro-code-in-WHERE-clause/m-p/445605#M69421</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-14T19:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Macros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-in-macro-code-in-WHERE-clause/m-p/445606#M69422</link>
      <description>&lt;P&gt;That explains the last part, but not why the first ones are renamed. You're also using them inconsistently, in some places you've used var_name and in some var_nm.&amp;nbsp; Not sure if that's intentional or not.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This method&amp;nbsp;was historically used to trim spaces, but there are other, better ways to do this now.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/195023"&gt;@sai99&lt;/a&gt; wrote:&lt;BR /&gt;I want to globalize sfixs, pfixs and suffixs but I am trying to avoid using local parametrs as global variables so used different variable names&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 19:23:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-in-macro-code-in-WHERE-clause/m-p/445606#M69422</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-14T19:23:07Z</dc:date>
    </item>
  </channel>
</rss>

