<?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 %sysevalf function has no expression to evaluate in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sysevalf-function-has-no-expression-to-evaluate/m-p/761396#M240933</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to run the below code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro temp2;
/*proc reg data=REPAM_DIF_EXTEND_ECONS1 outest=test plots=none;*/
/*m0: model IO_high_newhpi=&amp;amp;repam_dif_econs.	/SBC rsquare adjrsq dw vif;*/
%put &amp;amp;=model_vars.
	&amp;amp;=repam_dif_econs.;
%do i=1 %to %sysfunc(countw(&amp;amp;model_vars.,%str( )));
	%put &amp;amp;=i.;
	%let var_remove=%str();
	%do j=4 %to 0 %by -1;
		%put &amp;amp;=j.;
			%let var_remove=%sysfunc(catx(%str( ),&amp;amp;var_remove.,%scan(&amp;amp;repam_dif_econs.,%eval(5*&amp;amp;i.+&amp;amp;j.))));
				%put &amp;amp;=var_remove.;
/*				m%eval(5*&amp;amp;i.-&amp;amp;j.): model IO_high_newhpi=%sysfunc(transtrn(&amp;amp;repam_dif_econs.,&amp;amp;var_remove.,%str()))/ SBC rsquare adjrsq dw vif;*/
	%end;
%end;
/*run;*/
/*quit;*/
%mend temp2;
%temp2;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It produces the log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sas"&gt;25         GOPTIONS ACCESSIBLE;
26         %macro temp2;
27         /*proc reg data=REPAM_DIF_EXTEND_ECONS1 outest=test plots=none;*/
28         /*m0: model IO_high_newhpi=&amp;amp;repam_dif_econs.	/SBC rsquare adjrsq dw vif;*/
29         %put &amp;amp;=model_vars.
30         	&amp;amp;=repam_dif_econs.;
31         %do i=1 %to %sysfunc(countw(&amp;amp;model_vars.,%str( )));
32         	%put &amp;amp;=i.;
33         	%let var_remove=%str();
34         	%do j=4 %to 0 %by -1;
35         		%put &amp;amp;=j.;
36         			%let var_remove=%sysfunc(catx(%str( ),&amp;amp;var_remove.,%scan(&amp;amp;repam_dif_econs.,%eval(5*&amp;amp;i.+&amp;amp;j.))));
37         				%put &amp;amp;=var_remove.;
38         /*				m%eval(5*&amp;amp;i.-&amp;amp;j.): model IO_high_newhpi=%sysfunc(transtrn(&amp;amp;repam_dif_econs.,&amp;amp;var_remove.,%str()))/ SBC rsquare
38       ! adjrsq dw vif;*/
39         	%end;
40         %end;
41         /*run;*/
42         /*quit;*/
43         %mend temp2;
44         %temp2;
MODEL_VARS=HPIM_NSA_INDEX_NEWHPIb_yoy_l_11 ILO_UE_Qb_yoy_l_11 MIGb_bob_l_12 TOT_HH_DTI_EX_SLb_l2  
REPAM_DIF_ECONS=HPIM_NSA_INDEX_NEWHPIb_yoy_l_11 ILO_UE_Qb_yoy_l_11 MIGb_bob_l_12 TOT_HH_DTI_EX_SLb_l2 
HPIM_NSA_INDEX_NEWHPIb_yoy_d_l11 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l12 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l13 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l14 
HPIM_NSA_INDEX_NEWHPIb_yoy_d_l15 ILO_UE_Qb_yoy_d_l11 ILO_UE_Qb_yoy_d_l12 ILO_UE_Qb_yoy_d_l13 ILO_UE_Qb_yoy_d_l14 
ILO_UE_Qb_yoy_d_l15 MIGb_bob_d_l12 MIGb_bob_d_l13 MIGb_bob_d_l14 MIGb_bob_d_l15 MIGb_bob_d_l16 TOT_HH_DTI_EX_SLb_d_l_2 
TOT_HH_DTI_EX_SLb_d_l_3 TOT_HH_DTI_EX_SLb_d_l_4 TOT_HH_DTI_EX_SLb_d_l_5 TOT_HH_DTI_EX_SLb_d_l_6
I=1
J=4
ERROR: %SYSEVALF function has no expression to evaluate.
VAR_REMOVE=HPIM_NSA_INDEX_NEWHPIb_yoy_d_l15
J=3
2                                                          The SAS System                              10:41 Friday, August 13, 2021

VAR_REMOVE=HPIM_NSA_INDEX_NEWHPIb_yoy_d_l15 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l14
J=2
VAR_REMOVE=HPIM_NSA_INDEX_NEWHPIb_yoy_d_l15 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l14 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l13
J=1
VAR_REMOVE=HPIM_NSA_INDEX_NEWHPIb_yoy_d_l15 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l14 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l13 
HPIM_NSA_INDEX_NEWHPIb_yoy_d_l12
J=0
VAR_REMOVE=HPIM_NSA_INDEX_NEWHPIb_yoy_d_l15 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l14 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l13 
HPIM_NSA_INDEX_NEWHPIb_yoy_d_l12 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l11
I=2
J=4
ERROR: %SYSEVALF function has no expression to evaluate.
VAR_REMOVE=ILO_UE_Qb_yoy_d_l15
J=3
VAR_REMOVE=ILO_UE_Qb_yoy_d_l15 ILO_UE_Qb_yoy_d_l14
J=2
VAR_REMOVE=ILO_UE_Qb_yoy_d_l15 ILO_UE_Qb_yoy_d_l14 ILO_UE_Qb_yoy_d_l13
J=1
VAR_REMOVE=ILO_UE_Qb_yoy_d_l15 ILO_UE_Qb_yoy_d_l14 ILO_UE_Qb_yoy_d_l13 ILO_UE_Qb_yoy_d_l12
J=0
VAR_REMOVE=ILO_UE_Qb_yoy_d_l15 ILO_UE_Qb_yoy_d_l14 ILO_UE_Qb_yoy_d_l13 ILO_UE_Qb_yoy_d_l12 ILO_UE_Qb_yoy_d_l11
I=3
J=4&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As seen in the log, the code is generating the desired output, but it is also generating the error in the mentioned in the title, in spite of the absence of a %sysevalf function. I previously had a %sysevalf function in the code, which was suggested when trying to troubleshoot some other now resolved issue, and the error first arose when I ran it then. However, since returning to using the %eval() function, the error is still generated. I have restarted the session, tried the code in a new macro, tried the macro in a new program in the sas project, and tried running the magic string, but the error still persists. I have read on some similar threads that such an error can arise from the macro language trying to parse %str( ) in %sysfunc(catx( )) or %scan( ), but I need the string to be delimited %str( ) for my purposes. I don't know how to fix this, so any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Douglas&lt;/P&gt;</description>
    <pubDate>Fri, 13 Aug 2021 12:13:46 GMT</pubDate>
    <dc:creator>dh735</dc:creator>
    <dc:date>2021-08-13T12:13:46Z</dc:date>
    <item>
      <title>%sysevalf function has no expression to evaluate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sysevalf-function-has-no-expression-to-evaluate/m-p/761396#M240933</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to run the below code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro temp2;
/*proc reg data=REPAM_DIF_EXTEND_ECONS1 outest=test plots=none;*/
/*m0: model IO_high_newhpi=&amp;amp;repam_dif_econs.	/SBC rsquare adjrsq dw vif;*/
%put &amp;amp;=model_vars.
	&amp;amp;=repam_dif_econs.;
%do i=1 %to %sysfunc(countw(&amp;amp;model_vars.,%str( )));
	%put &amp;amp;=i.;
	%let var_remove=%str();
	%do j=4 %to 0 %by -1;
		%put &amp;amp;=j.;
			%let var_remove=%sysfunc(catx(%str( ),&amp;amp;var_remove.,%scan(&amp;amp;repam_dif_econs.,%eval(5*&amp;amp;i.+&amp;amp;j.))));
				%put &amp;amp;=var_remove.;
/*				m%eval(5*&amp;amp;i.-&amp;amp;j.): model IO_high_newhpi=%sysfunc(transtrn(&amp;amp;repam_dif_econs.,&amp;amp;var_remove.,%str()))/ SBC rsquare adjrsq dw vif;*/
	%end;
%end;
/*run;*/
/*quit;*/
%mend temp2;
%temp2;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It produces the log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sas"&gt;25         GOPTIONS ACCESSIBLE;
26         %macro temp2;
27         /*proc reg data=REPAM_DIF_EXTEND_ECONS1 outest=test plots=none;*/
28         /*m0: model IO_high_newhpi=&amp;amp;repam_dif_econs.	/SBC rsquare adjrsq dw vif;*/
29         %put &amp;amp;=model_vars.
30         	&amp;amp;=repam_dif_econs.;
31         %do i=1 %to %sysfunc(countw(&amp;amp;model_vars.,%str( )));
32         	%put &amp;amp;=i.;
33         	%let var_remove=%str();
34         	%do j=4 %to 0 %by -1;
35         		%put &amp;amp;=j.;
36         			%let var_remove=%sysfunc(catx(%str( ),&amp;amp;var_remove.,%scan(&amp;amp;repam_dif_econs.,%eval(5*&amp;amp;i.+&amp;amp;j.))));
37         				%put &amp;amp;=var_remove.;
38         /*				m%eval(5*&amp;amp;i.-&amp;amp;j.): model IO_high_newhpi=%sysfunc(transtrn(&amp;amp;repam_dif_econs.,&amp;amp;var_remove.,%str()))/ SBC rsquare
38       ! adjrsq dw vif;*/
39         	%end;
40         %end;
41         /*run;*/
42         /*quit;*/
43         %mend temp2;
44         %temp2;
MODEL_VARS=HPIM_NSA_INDEX_NEWHPIb_yoy_l_11 ILO_UE_Qb_yoy_l_11 MIGb_bob_l_12 TOT_HH_DTI_EX_SLb_l2  
REPAM_DIF_ECONS=HPIM_NSA_INDEX_NEWHPIb_yoy_l_11 ILO_UE_Qb_yoy_l_11 MIGb_bob_l_12 TOT_HH_DTI_EX_SLb_l2 
HPIM_NSA_INDEX_NEWHPIb_yoy_d_l11 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l12 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l13 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l14 
HPIM_NSA_INDEX_NEWHPIb_yoy_d_l15 ILO_UE_Qb_yoy_d_l11 ILO_UE_Qb_yoy_d_l12 ILO_UE_Qb_yoy_d_l13 ILO_UE_Qb_yoy_d_l14 
ILO_UE_Qb_yoy_d_l15 MIGb_bob_d_l12 MIGb_bob_d_l13 MIGb_bob_d_l14 MIGb_bob_d_l15 MIGb_bob_d_l16 TOT_HH_DTI_EX_SLb_d_l_2 
TOT_HH_DTI_EX_SLb_d_l_3 TOT_HH_DTI_EX_SLb_d_l_4 TOT_HH_DTI_EX_SLb_d_l_5 TOT_HH_DTI_EX_SLb_d_l_6
I=1
J=4
ERROR: %SYSEVALF function has no expression to evaluate.
VAR_REMOVE=HPIM_NSA_INDEX_NEWHPIb_yoy_d_l15
J=3
2                                                          The SAS System                              10:41 Friday, August 13, 2021

VAR_REMOVE=HPIM_NSA_INDEX_NEWHPIb_yoy_d_l15 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l14
J=2
VAR_REMOVE=HPIM_NSA_INDEX_NEWHPIb_yoy_d_l15 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l14 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l13
J=1
VAR_REMOVE=HPIM_NSA_INDEX_NEWHPIb_yoy_d_l15 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l14 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l13 
HPIM_NSA_INDEX_NEWHPIb_yoy_d_l12
J=0
VAR_REMOVE=HPIM_NSA_INDEX_NEWHPIb_yoy_d_l15 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l14 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l13 
HPIM_NSA_INDEX_NEWHPIb_yoy_d_l12 HPIM_NSA_INDEX_NEWHPIb_yoy_d_l11
I=2
J=4
ERROR: %SYSEVALF function has no expression to evaluate.
VAR_REMOVE=ILO_UE_Qb_yoy_d_l15
J=3
VAR_REMOVE=ILO_UE_Qb_yoy_d_l15 ILO_UE_Qb_yoy_d_l14
J=2
VAR_REMOVE=ILO_UE_Qb_yoy_d_l15 ILO_UE_Qb_yoy_d_l14 ILO_UE_Qb_yoy_d_l13
J=1
VAR_REMOVE=ILO_UE_Qb_yoy_d_l15 ILO_UE_Qb_yoy_d_l14 ILO_UE_Qb_yoy_d_l13 ILO_UE_Qb_yoy_d_l12
J=0
VAR_REMOVE=ILO_UE_Qb_yoy_d_l15 ILO_UE_Qb_yoy_d_l14 ILO_UE_Qb_yoy_d_l13 ILO_UE_Qb_yoy_d_l12 ILO_UE_Qb_yoy_d_l11
I=3
J=4&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As seen in the log, the code is generating the desired output, but it is also generating the error in the mentioned in the title, in spite of the absence of a %sysevalf function. I previously had a %sysevalf function in the code, which was suggested when trying to troubleshoot some other now resolved issue, and the error first arose when I ran it then. However, since returning to using the %eval() function, the error is still generated. I have restarted the session, tried the code in a new macro, tried the macro in a new program in the sas project, and tried running the magic string, but the error still persists. I have read on some similar threads that such an error can arise from the macro language trying to parse %str( ) in %sysfunc(catx( )) or %scan( ), but I need the string to be delimited %str( ) for my purposes. I don't know how to fix this, so any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Douglas&lt;/P&gt;</description>
      <pubDate>Fri, 13 Aug 2021 12:13:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sysevalf-function-has-no-expression-to-evaluate/m-p/761396#M240933</guid>
      <dc:creator>dh735</dc:creator>
      <dc:date>2021-08-13T12:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: %sysevalf function has no expression to evaluate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sysevalf-function-has-no-expression-to-evaluate/m-p/761403#M240935</link>
      <description>&lt;P&gt;Use this command to provide macro debugging information:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options symbolgen mlogic mprint;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then re-run the code, and examine the log.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Aug 2021 12:25:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sysevalf-function-has-no-expression-to-evaluate/m-p/761403#M240935</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-08-13T12:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: %sysevalf function has no expression to evaluate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sysevalf-function-has-no-expression-to-evaluate/m-p/761405#M240936</link>
      <description>&lt;P&gt;For the benefit of anybody reading along, I just removed the catx step to concatenate strings, which you seemingly do not need when working with macros (I guess because it just reads everything as text). This solution tallies up with other post pertaining to %sysevalf errors when using %sysfunc(catx( )) on macro strings. &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro temp2;
proc reg data=REPAM_DIF_EXTEND_ECONS1 outest=test plots=none;
m0: model IO_high_newhpi=&amp;amp;repam_dif_econs.	/SBC rsquare adjrsq dw vif;
/*%put &amp;amp;=model_vars.*/
/*	&amp;amp;=repam_dif_econs.;*/
%do i=1 %to %sysfunc(countw(&amp;amp;model_vars.,%str( )));
	%put &amp;amp;=i.;
	%let var_remove=%str();
	%do j=0 %to 4;
		%put &amp;amp;=j.;

			%let var_remove=%sysfunc(strip(&amp;amp;var_remove. %scan(&amp;amp;repam_dif_econs.,%eval(5*&amp;amp;i.+&amp;amp;j.),%str( ))));
				%put &amp;amp;=var_remove.;
				m%eval(5*&amp;amp;i.-&amp;amp;j.): model IO_high_newhpi=%sysfunc(transtrn(&amp;amp;repam_dif_econs.,&amp;amp;var_remove.,%str()))/ SBC rsquare adjrsq dw vif;
	%end;
%end;
run;
quit;
%mend temp2;
%temp2;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Aug 2021 12:49:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sysevalf-function-has-no-expression-to-evaluate/m-p/761405#M240936</guid>
      <dc:creator>dh735</dc:creator>
      <dc:date>2021-08-13T12:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: %sysevalf function has no expression to evaluate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sysevalf-function-has-no-expression-to-evaluate/m-p/761407#M240938</link>
      <description>&lt;P&gt;For the benefit of anyone reading along,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/334913"&gt;@dh735&lt;/a&gt;&amp;nbsp;please explain what you changed and why this code is now marked correct.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Aug 2021 12:42:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sysevalf-function-has-no-expression-to-evaluate/m-p/761407#M240938</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-08-13T12:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: %sysevalf function has no expression to evaluate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sysevalf-function-has-no-expression-to-evaluate/m-p/761409#M240940</link>
      <description>&lt;P&gt;I don't know if it has anything to do with your problem, but why would you write code like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let var_remove=%sysfunc(catx(%str( ),&amp;amp;var_remove.,%scan(&amp;amp;repam_dif_econs.,%eval(5*&amp;amp;i.+&amp;amp;j.))));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There is no need to use CATX() to add a space between values.&amp;nbsp; Just type the space!&lt;/P&gt;
&lt;P&gt;Plus %SCAN() knows how to call %EVAL() (%sysfunc() does also).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let var_remove=&amp;amp;var_remove. %scan(&amp;amp;repam_dif_econs.,5*&amp;amp;i.+&amp;amp;j.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Aug 2021 12:47:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sysevalf-function-has-no-expression-to-evaluate/m-p/761409#M240940</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-08-13T12:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: %sysevalf function has no expression to evaluate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sysevalf-function-has-no-expression-to-evaluate/m-p/761410#M240941</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;"why would you write code like this?": Because I don't know any better &lt;span class="lia-unicode-emoji" title=":grimacing_face:"&gt;😬&lt;/span&gt;&lt;/LI&gt;&lt;LI&gt;"%Scan knows how to call %Eval": I never knew that about %scan, thank you!&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Douglas&lt;/P&gt;</description>
      <pubDate>Fri, 13 Aug 2021 12:52:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sysevalf-function-has-no-expression-to-evaluate/m-p/761410#M240941</guid>
      <dc:creator>dh735</dc:creator>
      <dc:date>2021-08-13T12:52:20Z</dc:date>
    </item>
  </channel>
</rss>

