<?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: Apparent symbolic reference not resolved? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/669630#M200907</link>
    <description>Thank you for the great suggestion, both ways worked!</description>
    <pubDate>Wed, 15 Jul 2020 17:55:32 GMT</pubDate>
    <dc:creator>ybz12003</dc:creator>
    <dc:date>2020-07-15T17:55:32Z</dc:date>
    <item>
      <title>Apparent symbolic reference not resolved?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/669549#M200869</link>
      <description>&lt;P&gt;Hello,W&lt;/P&gt;
&lt;P&gt;I have program list below, I found out when I add underscore '_' behind the macro i, the log showed that error message.&amp;nbsp; But it&amp;nbsp;works fine after I removed it.&amp;nbsp;&amp;nbsp; What if I would like to add _ behind i?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let Y1=Cin;
%let Y2=Kan;
%let Y3=Vand;

%macro import;
	%do i = 1 %to 3;

	%let folder="Pathway";

		PROC IMPORT OUT=work.Repeater_&amp;amp;&amp;amp;Y&amp;amp;i.
			datafile=&amp;amp;folder
			dbms=xlsx replace;
			sheet=ARI;
		run;
		
		data Repeater_&amp;amp;&amp;amp;Y&amp;amp;i._;
			set Repeater_&amp;amp;&amp;amp;Y&amp;amp;i.;
			%do k = 1 %to 5;
			 	CaseID_&amp;amp;k. =upcase(compress(CaseID_&amp;amp;k., '-'));
				put CaseID_&amp;amp;k.;
			%end;
		run;

	  	%end;
%mend;
%import;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;It seems like the warning message shown from the codes:&lt;/P&gt;
&lt;PRE&gt;data Repeater_&amp;amp;&amp;amp;Y&amp;amp;i._;&lt;/PRE&gt;
&lt;P&gt;WARNING: Apparent symbolic reference Y3_ not resolved.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 16:02:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/669549#M200869</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2020-07-15T16:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: Apparent symbolic reference not resolved?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/669557#M200873</link>
      <description>&lt;P&gt;You need a double dot to separate repeater_&amp;amp;&amp;amp;Y&amp;amp;i from the following underscore.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For future reference, when you have these types of issues with macro variables, you can use&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint symbolgen;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to get more information in the SAS log that will help you debug macro issues. Had you done that, the log would immediately identify the problem&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;SYMBOLGEN:  &amp;amp;&amp;amp; resolves to &amp;amp;.
SYMBOLGEN:  Macro variable I resolves to 1
WARNING: Apparent symbolic reference Y1_ not resolved.
Repeater_&amp;amp;Y1_
&lt;/PRE&gt;
&lt;P&gt;Of course, you could make your life even easier by not putting an underscore following a macro variable. Instead of&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data Repeater_&amp;amp;&amp;amp;Y&amp;amp;i._;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;with an underscore (or really any character) after the macro variable at the end, you could use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _Repeater_&amp;amp;&amp;amp;Y&amp;amp;i;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then these types of problem go away.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 16:21:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/669557#M200873</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-15T16:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Apparent symbolic reference not resolved?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/669574#M200883</link>
      <description>&lt;P&gt;This brings up another macro writing issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	%do i = 1 %to 3;
	    %let folder="Pathway";
		PROC IMPORT OUT=work.Repeater_&amp;amp;&amp;amp;Y&amp;amp;i.
			datafile=&amp;amp;folder
			dbms=xlsx replace;
			sheet=ARI;
		run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The above PROC IMPORT is repeated three times, because &amp;amp;i goes from 1 to 3, but it is producing the exact same data set each time, only the data set name changes. I don't really see a point to doing this three times, and getting three identical data sets.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 16:29:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/669574#M200883</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-15T16:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Apparent symbolic reference not resolved?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/669630#M200907</link>
      <description>Thank you for the great suggestion, both ways worked!</description>
      <pubDate>Wed, 15 Jul 2020 17:55:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/669630#M200907</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2020-07-15T17:55:32Z</dc:date>
    </item>
  </channel>
</rss>

