<?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: SAS: Warning Apparent symbolic reference not resolved in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/558017#M155662</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/273698"&gt;@dxs8292&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wonder why you need all the looping. If I understand your code, you create several lists of variables, where each list contains variables with counter value in a given 1000-interval, and then you drop all these variables from the output data set.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As pointed out by others, there are several things that can give problems, and with a simpler code fewer things can go wrong. So - unless I missed something - this code will do the same:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro extract(input_data, input_list, size, output_data);
	%let droplist =;
	proc sql noprint;
		select distinct trim(variable)
		into :numlist separated by ' '
		from &amp;amp;input_list
		where counter &amp;lt;= %eval(&amp;amp;size*1000);
	quit;
	%if &amp;amp;sqlobs &amp;gt; 0 %then %let droplist = drop &amp;amp;numlist;

	data &amp;amp;output_data(compress=yes); 
		set &amp;amp;input_data;
		&amp;amp;droplist;
	run;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 11 May 2019 09:02:59 GMT</pubDate>
    <dc:creator>ErikLund_Jensen</dc:creator>
    <dc:date>2019-05-11T09:02:59Z</dc:date>
    <item>
      <title>SAS: Warning Apparent symbolic reference not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/557941#M155619</link>
      <description>&lt;P&gt;I am running the macro variable %extract from a bigger program, but I get a warning that certain macro variables are not resolve. These macro variables get created in the %extract macro(using proc sql). The macro variables are numlist1--numlist6, these macros variables called later in a datastep to drop a bunch of variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The SAS Macro is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; extract(input_data,input_list,size,output_data); &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;select distinct trim(variable)&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;into :numlist1 separated by &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;from &amp;amp;input_list&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;where counter &amp;lt;= &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1000&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; j=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%to&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;size;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select distinct trim(variable)&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; into: numlist&amp;amp;j separated by &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from &amp;amp;input_list&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;where &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%eval&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;((&amp;amp;j-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;)*&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1000&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) &amp;lt; counter &amp;lt;= &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%eval&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&amp;amp;j*&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1000&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data &amp;amp;output_data(compress=yes);set &amp;amp;input_data;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp; drop &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; j=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%to&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;size; &amp;amp;&amp;amp;numlist&amp;amp;j &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;%&lt;STRONG&gt;&lt;I&gt;extract&lt;/I&gt;&lt;/STRONG&gt;(&amp;amp;Prefix.OUT_INC,&amp;amp;SRC73,&amp;amp;numobs73,&amp;amp;OUTPUT_INC_FEAT);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following is the SAS Log&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): Beginning execution.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable PREFIX resolves to WORK.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable SRC73 resolves to DATAMODL.PROD_COPD_COMM_INC_DROPFEAT&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable NUMOBS73 resolves to 6&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable OUTPUT_INC_FEAT resolves to DATAMODL.COPD_COMM_INC_PROD&lt;/P&gt;&lt;P&gt;74492 +%extract(&amp;amp;Prefix.OUT_INC,&amp;amp;SRC73,&amp;amp;numobs73,&amp;amp;OUTPUT_INC_FEAT);&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): Parameter INPUT_DATA has value WORK.OUT_INC&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): Parameter INPUT_LIST has value DATAMODL.PROD_COPD_COMM_INC_DROPFEAT&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): Parameter SIZE has value 6&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): Parameter OUTPUT_DATA has value DATAMODL.COPD_COMM_INC_PROD&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): proc sql noprint;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable INPUT_LIST resolves to DATAMODL.PROD_COPD_COMM_INC_DROPFEAT&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): select distinct trim(variable) into :numlist1 separated by ' ' from DATAMODL.PROD_COPD_COMM_INC_DROPFEAT where&lt;/P&gt;&lt;P&gt;counter &amp;lt;= 1000;&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): quit;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable SIZE resolves to 6&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop beginning; index variable J; start value is 2; stop value is 6; by value is 1.&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): proc sql noprint;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 2&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable INPUT_LIST resolves to DATAMODL.PROD_COPD_COMM_INC_DROPFEAT&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 2&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 2&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): select distinct trim(variable) into: numlist2 separated by ' ' from DATAMODL.PROD_COPD_COMM_INC_DROPFEAT where&lt;/P&gt;&lt;P&gt;1000 &amp;lt; counter &amp;lt;= 2000;&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): quit;&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 3; loop will iterate again.&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): proc sql noprint;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 3&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable INPUT_LIST resolves to DATAMODL.PROD_COPD_COMM_INC_DROPFEAT&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 3&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 3&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): select distinct trim(variable) into: numlist3 separated by ' ' from DATAMODL.PROD_COPD_COMM_INC_DROPFEAT where&lt;/P&gt;&lt;P&gt;2000 &amp;lt; counter &amp;lt;= 3000;&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): quit;&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 4; loop will iterate again.&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): proc sql noprint;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 4&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable INPUT_LIST resolves to DATAMODL.PROD_COPD_COMM_INC_DROPFEAT&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 4&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 4&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): select distinct trim(variable) into: numlist4 separated by ' ' from DATAMODL.PROD_COPD_COMM_INC_DROPFEAT where&lt;/P&gt;&lt;P&gt;3000 &amp;lt; counter &amp;lt;= 4000;&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): quit;&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 5; loop will iterate again.&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): proc sql noprint;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 5&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable INPUT_LIST resolves to DATAMODL.PROD_COPD_COMM_INC_DROPFEAT&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 5&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 5&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): select distinct trim(variable) into: numlist5 separated by ' ' from DATAMODL.PROD_COPD_COMM_INC_DROPFEAT where&lt;/P&gt;&lt;P&gt;4000 &amp;lt; counter &amp;lt;= 5000;&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): quit;&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 6; loop will iterate again.&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): proc sql noprint;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 6&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable INPUT_LIST resolves to DATAMODL.PROD_COPD_COMM_INC_DROPFEAT&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 6&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 6&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): select distinct trim(variable) into: numlist6 separated by ' ' from DATAMODL.PROD_COPD_COMM_INC_DROPFEAT where&lt;/P&gt;&lt;P&gt;5000 &amp;lt; counter &amp;lt;= 6000;&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): quit;&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 7; loop will not iterate again.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable OUTPUT_DATA resolves to DATAMODL.COPD_COMM_INC_PROD&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): data DATAMODL.COPD_COMM_INC_PROD(compress=yes);&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable INPUT_DATA resolves to WORK.OUT_INC&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): set WORK.OUT_INC;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable SIZE resolves to 6&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop beginning; index variable J; start value is 1; stop value is 6; by value is 1.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: &amp;amp;&amp;amp; resolves to &amp;amp;.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 1&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference NUMLIST1 not resolved.&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 2; loop will iterate again.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: &amp;amp;&amp;amp; resolves to &amp;amp;.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 2&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference NUMLIST2 not resolved.&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 3; loop will iterate again.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: &amp;amp;&amp;amp; resolves to &amp;amp;.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 3&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference NUMLIST3 not resolved.&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 4; loop will iterate again.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: &amp;amp;&amp;amp; resolves to &amp;amp;.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 4&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference NUMLIST4 not resolved.&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 5; loop will iterate again.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: &amp;amp;&amp;amp; resolves to &amp;amp;.&lt;/P&gt;&lt;P&gt;5796 The SAS System&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 5&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference NUMLIST5 not resolved.&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 6; loop will iterate again.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: &amp;amp;&amp;amp; resolves to &amp;amp;.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 6&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference NUMLIST6 not resolved.&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 7; loop will not iterate again.&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): drop &amp;amp;numlist1 &amp;amp;numlist2 &amp;amp;numlist3 &amp;amp;numlist4 &amp;amp;numlist5 &amp;amp;numlist6;&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): run;&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): Ending execution.&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): Beginning execution.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable PREFIX resolves to WORK.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable SRC73 resolves to DATAMODL.PROD_COPD_COMM_INC_DROPFEAT&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable NUMOBS73 resolves to 6&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable OUTPUT_INC_FEAT resolves to DATAMODL.COPD_COMM_INC_PROD&lt;/P&gt;&lt;P&gt;74492 +%extract(&amp;amp;Prefix.OUT_INC,&amp;amp;SRC73,&amp;amp;numobs73,&amp;amp;OUTPUT_INC_FEAT);&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): Parameter INPUT_DATA has value WORK.OUT_INC&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): Parameter INPUT_LIST has value DATAMODL.PROD_COPD_COMM_INC_DROPFEAT&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): Parameter SIZE has value 6&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): Parameter OUTPUT_DATA has value DATAMODL.COPD_COMM_INC_PROD&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): proc sql noprint;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable INPUT_LIST resolves to DATAMODL.PROD_COPD_COMM_INC_DROPFEAT&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): select distinct trim(variable) into :numlist1 separated by ' ' from DATAMODL.PROD_COPD_COMM_INC_DROPFEAT where&lt;/P&gt;&lt;P&gt;counter &amp;lt;= 1000;&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): quit;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable SIZE resolves to 6&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop beginning; index variable J; start value is 2; stop value is 6; by value is 1.&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): proc sql noprint;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 2&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable INPUT_LIST resolves to DATAMODL.PROD_COPD_COMM_INC_DROPFEAT&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 2&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 2&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): select distinct trim(variable) into: numlist2 separated by ' ' from DATAMODL.PROD_COPD_COMM_INC_DROPFEAT where&lt;/P&gt;&lt;P&gt;1000 &amp;lt; counter &amp;lt;= 2000;&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): quit;&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 3; loop will iterate again.&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): proc sql noprint;&lt;/P&gt;&lt;P&gt;5795 The SAS System&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 3&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable INPUT_LIST resolves to DATAMODL.PROD_COPD_COMM_INC_DROPFEAT&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 3&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 3&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): select distinct trim(variable) into: numlist3 separated by ' ' from DATAMODL.PROD_COPD_COMM_INC_DROPFEAT where&lt;/P&gt;&lt;P&gt;2000 &amp;lt; counter &amp;lt;= 3000;&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): quit;&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 4; loop will iterate again.&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): proc sql noprint;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 4&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable INPUT_LIST resolves to DATAMODL.PROD_COPD_COMM_INC_DROPFEAT&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 4&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 4&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): select distinct trim(variable) into: numlist4 separated by ' ' from DATAMODL.PROD_COPD_COMM_INC_DROPFEAT where&lt;/P&gt;&lt;P&gt;3000 &amp;lt; counter &amp;lt;= 4000;&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): quit;&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 5; loop will iterate again.&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): proc sql noprint;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 5&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable INPUT_LIST resolves to DATAMODL.PROD_COPD_COMM_INC_DROPFEAT&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 5&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 5&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): select distinct trim(variable) into: numlist5 separated by ' ' from DATAMODL.PROD_COPD_COMM_INC_DROPFEAT where&lt;/P&gt;&lt;P&gt;4000 &amp;lt; counter &amp;lt;= 5000;&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): quit;&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 6; loop will iterate again.&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): proc sql noprint;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 6&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable INPUT_LIST resolves to DATAMODL.PROD_COPD_COMM_INC_DROPFEAT&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 6&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 6&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): select distinct trim(variable) into: numlist6 separated by ' ' from DATAMODL.PROD_COPD_COMM_INC_DROPFEAT where&lt;/P&gt;&lt;P&gt;5000 &amp;lt; counter &amp;lt;= 6000;&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): quit;&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 7; loop will not iterate again.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable OUTPUT_DATA resolves to DATAMODL.COPD_COMM_INC_PROD&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): data DATAMODL.COPD_COMM_INC_PROD(compress=yes);&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable INPUT_DATA resolves to WORK.OUT_INC&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): set WORK.OUT_INC;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable SIZE resolves to 6&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop beginning; index variable J; start value is 1; stop value is 6; by value is 1.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: &amp;amp;&amp;amp; resolves to &amp;amp;.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 1&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference NUMLIST1 not resolved.&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 2; loop will iterate again.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: &amp;amp;&amp;amp; resolves to &amp;amp;.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 2&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference NUMLIST2 not resolved.&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 3; loop will iterate again.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: &amp;amp;&amp;amp; resolves to &amp;amp;.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 3&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference NUMLIST3 not resolved.&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 4; loop will iterate again.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: &amp;amp;&amp;amp; resolves to &amp;amp;.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 4&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference NUMLIST4 not resolved.&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 5; loop will iterate again.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: &amp;amp;&amp;amp; resolves to &amp;amp;.&lt;/P&gt;&lt;P&gt;5796 The SAS System&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 5&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference NUMLIST5 not resolved.&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 6; loop will iterate again.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: &amp;amp;&amp;amp; resolves to &amp;amp;.&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable J resolves to 6&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference NUMLIST6 not resolved.&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): %DO loop index variable J is now 7; loop will not iterate again.&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): drop &amp;amp;numlist1 &amp;amp;numlist2 &amp;amp;numlist3 &amp;amp;numlist4 &amp;amp;numlist5 &amp;amp;numlist6;&lt;/P&gt;&lt;P&gt;MPRINT(EXTRACT): run;&lt;/P&gt;&lt;P&gt;MLOGIC(EXTRACT): Ending execution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 19:46:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/557941#M155619</guid>
      <dc:creator>dxs8292</dc:creator>
      <dc:date>2019-05-10T19:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS: Warning Apparent symbolic reference not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/557982#M155641</link>
      <description>&lt;P&gt;Have you explored basic issues about the data?&amp;nbsp; Within the data set WORK.OUT_INC:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Does it contain any observations at all?&lt;/LI&gt;
&lt;LI&gt;Does it contain a variable named COUNTER with values that are less than 1,000 ?&lt;/LI&gt;
&lt;LI&gt;Does it contain a variable named VARIABLE with non-missing values in it?&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;From your results, my guess is that's where you start to look, to find out what is wrong.&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 21:40:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/557982#M155641</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-05-10T21:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: SAS: Warning Apparent symbolic reference not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/558003#M155659</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/273698"&gt;@dxs8292&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A PROC SQL INTO clause only creates macro variables if the SQL returns rows. It appears that doesn't happen in your case and for that reason the macro variables don't get created at all (and though the warnings).&lt;/P&gt;
&lt;P&gt;If you want to ensure that the macro variables always exist then add a piece of code which does this for you. Something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  %do j=1 %to &amp;amp;size;
    %let numlist&amp;amp;j=;
  %end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Eventually consider to also add some logic to check if your SQL returns the number of rows you'd expect. The automatic macro variable &amp;amp;SQLOBS is most useful for that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 May 2019 05:37:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/558003#M155659</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-05-11T05:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS: Warning Apparent symbolic reference not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/558017#M155662</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/273698"&gt;@dxs8292&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wonder why you need all the looping. If I understand your code, you create several lists of variables, where each list contains variables with counter value in a given 1000-interval, and then you drop all these variables from the output data set.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As pointed out by others, there are several things that can give problems, and with a simpler code fewer things can go wrong. So - unless I missed something - this code will do the same:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro extract(input_data, input_list, size, output_data);
	%let droplist =;
	proc sql noprint;
		select distinct trim(variable)
		into :numlist separated by ' '
		from &amp;amp;input_list
		where counter &amp;lt;= %eval(&amp;amp;size*1000);
	quit;
	%if &amp;amp;sqlobs &amp;gt; 0 %then %let droplist = drop &amp;amp;numlist;

	data &amp;amp;output_data(compress=yes); 
		set &amp;amp;input_data;
		&amp;amp;droplist;
	run;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 May 2019 09:02:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/558017#M155662</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2019-05-11T09:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS: Warning Apparent symbolic reference not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/558081#M155703</link>
      <description>&lt;P&gt;I need to do looping because my macro variable gets very large and get the following message if I don't do any looping&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: The length of the value of the macro variable NUMLIST (65540) exceeds the maximum length (65534). The value has been&lt;/P&gt;&lt;P&gt;truncated to 65534 characters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is huge dataset with over 20,000 variables and I want to drop over 5000 variables,&amp;nbsp; In other datasets I even want to drop more variables. That is why I am doing all the looping&lt;/P&gt;</description>
      <pubDate>Sat, 11 May 2019 23:01:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/558081#M155703</guid>
      <dc:creator>dxs8292</dc:creator>
      <dc:date>2019-05-11T23:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS: Warning Apparent symbolic reference not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/558082#M155704</link>
      <description>&lt;P&gt;Sorry I should have pasted in the dataset &amp;amp;input_list&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE cellspacing="10"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;TABLE cellspacing="10"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;TABLE cellspacing="10"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;TABLE cellspacing="10"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;TABLE cellspacing="10"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P class="proctitle"&gt;&lt;SPAN class="proctitle"&gt;The&amp;nbsp;CONTENTS&amp;nbsp;Procedure&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;TABLE cellspacing="10"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;DIV&gt;&lt;TABLE cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Data Set Name&lt;/TD&gt;&lt;TD&gt;DATAMODL.PROD_COPD_COMM_INC_DROPFEAT&lt;/TD&gt;&lt;TD&gt;Observations&lt;/TD&gt;&lt;TD&gt;5568&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Member Type&lt;/TD&gt;&lt;TD&gt;DATA&lt;/TD&gt;&lt;TD&gt;Variables&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Engine&lt;/TD&gt;&lt;TD&gt;BASE&lt;/TD&gt;&lt;TD&gt;Indexes&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Created&lt;/TD&gt;&lt;TD&gt;04/26/2019 20:00:02&lt;/TD&gt;&lt;TD&gt;Observation Length&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Last Modified&lt;/TD&gt;&lt;TD&gt;04/26/2019 20:00:02&lt;/TD&gt;&lt;TD&gt;Deleted Observations&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Protection&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Compressed&lt;/TD&gt;&lt;TD&gt;CHAR&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Data Set Type&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Reuse Space&lt;/TD&gt;&lt;TD&gt;NO&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Label&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Point to Observations&lt;/TD&gt;&lt;TD&gt;YES&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Data Representation&lt;/TD&gt;&lt;TD&gt;HP_UX_64, RS_6000_AIX_64, SOLARIS_64, HP_IA64&lt;/TD&gt;&lt;TD&gt;Sorted&lt;/TD&gt;&lt;TD&gt;NO&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Encoding&lt;/TD&gt;&lt;TD&gt;latin1 Western (ISO)&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;DIV&gt;Engine/Host Dependent Information &lt;TABLE cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Data Set Page Size&lt;/TD&gt;&lt;TD&gt;262144&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Number of Data Set Pages&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Number of Data Set Repairs&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Filename&lt;/TD&gt;&lt;TD&gt;/datamodl/prod_copd_comm_inc_dropfeat.sas7bdat&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Release Created&lt;/TD&gt;&lt;TD&gt;9.0401M3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Host Created&lt;/TD&gt;&lt;TD&gt;AIX&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Inode Number&lt;/TD&gt;&lt;TD&gt;1077755&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Access Permission&lt;/TD&gt;&lt;TD&gt;rw-r-----&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Owner Name&lt;/TD&gt;&lt;TD&gt;jxf9025&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;File Size&lt;/TD&gt;&lt;TD&gt;1MB&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;File Size (bytes)&lt;/TD&gt;&lt;TD&gt;1048576&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;DIV&gt;Alphabetic List of Variables and Attributes# Variable Type Len &lt;TABLE cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;counter&lt;/TD&gt;&lt;TD&gt;Num&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;variable&lt;/TD&gt;&lt;TD&gt;Char&lt;/TD&gt;&lt;TD&gt;32&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Sat, 11 May 2019 23:11:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/558082#M155704</guid>
      <dc:creator>dxs8292</dc:creator>
      <dc:date>2019-05-11T23:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAS: Warning Apparent symbolic reference not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/558099#M155715</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/273698"&gt;@dxs8292&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below coding approach should be able to deal with your variable galore without the need of looping.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* create sample data */
data have;
  array vv_123456789_123456789_abc_ {20000} $1 (20000*'A');
  set sashelp.class;
run;

data vars_to_drop(drop=_:);
  length variable $32;
  do _i=1 to 9999, 10001 to 20000;
    variable=cats('vv_123456789_123456789_abc_',put(_i,f5.));
    output;
  end;
  stop;
run;

/* define and execute macro to drop variables from source dataset */
%macro DropVars(input_data, drop_list, output_data);
  %if %bquote(&amp;amp;output_data) = %bquote() %then %let output_data=input_data;

  /* generate data step code for dropping variables */
  filename codegen temp;
  data _null_;
  /*  file print;*/
    file codegen;
    set &amp;amp;drop_list end=last;
    if _n_=1 then
      do;
        put 
            "data &amp;amp;output_data;"
          / "  set &amp;amp;input_data (drop="
          ;
      end;
    put "    " variable;
    if last then
      do;
        put 
            "    );"
          / "run;"
          ;
      end;
  run;

  /* execute generated code */
  %include codegen / nosource2;
/*  %include codegen / source2;*/

  filename codegen clear;
%mend;

%DropVars(have, vars_to_drop, want);

proc contents data=want;;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also: If you've got that many variables then I'd assume there is some naming pattern used. Have you already investigated if you could eventually take advantage of this to use any of below syntax.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
/* dash: drop ranges of variables - requires the variables to end with a number */
data want2;
  set have(drop=
            vv_123456789_123456789_abc_1 - vv_123456789_123456789_abc_9999 
            vv_123456789_123456789_abc_10001 - vv_123456789_123456789_abc_20000
            );
run;
proc contents data=want2;
run;

/* column: drop variables using column modifier (wildcard) */
data want3;
  set have(drop=vv_123456789_123456789_abc_:);
run;
proc contents data=want3;
run;

/* double dash: drop ranges of variables based on physical sequence in data set (varnum)*/
data have4;
  length varY varC varX varB varZ $1;
  stop;
run;
proc contents data=have4 varnum;
run;
data want4(drop=varC -- varB);
  set have4;
run;
proc contents data=want4;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 12 May 2019 03:20:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/558099#M155715</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-05-12T03:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: SAS: Warning Apparent symbolic reference not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/558114#M155727</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/273698"&gt;@dxs8292&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry - I didn't think of that, because I never had to deal with tables that wide. But then I think a better solution would be to avoid macro vaiables instead of trying to circumvent the 65k limit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried the following code and found it a working solution with 50000 variables. The log becomes rather big, because each call execute line is written to it, but that part of the log could be redirected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro extract(input_data, input_list, size, output_data);
	proc sql;
		create table droplist as
			select variable 
			from &amp;amp;input_list
			where counter &amp;lt; 0;* %eval(&amp;amp;size*1000);
	quit;

	data _null_; set droplist end=eof;
		if _N_ = 1 then call execute("data &amp;amp;output_data; set &amp;amp;input_data;");
		call execute("drop "||variable||";");
		if eof then call execute("run;");
	run;
%mend;
%extract(input_data, input_list, 6, output_data);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 May 2019 09:19:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/558114#M155727</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2019-05-12T09:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAS: Warning Apparent symbolic reference not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/558115#M155728</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/273698"&gt;@dxs8292&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I forgot to post my test data, here they are for your further experiments:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* make a test data set with 50000 variables;
data x; 
	do i = 1 to 50000;
		var = i;
		output;
	end;
run;
proc transpose data=x out=input_data prefix=Variable_name_;
run;

* make a test variable list with counter = 0, 1000, 2000 ... 9000;
data input_list; 
	do i = 1 to 50000;
		variable = 'Variable_name_'||strip(put(i,8.));
		counter = mod(i,10)*1000;
		output;
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 May 2019 09:26:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/558115#M155728</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2019-05-12T09:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAS: Warning Apparent symbolic reference not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/558138#M155737</link>
      <description>&lt;P&gt;I never like using "arrays" of macro variables. Usually they are used in situations like this one where they are not needed.&lt;/P&gt;
&lt;P&gt;Just generate the DROP statement into a file and then %INCLUDE the file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro extract(input_data,input_list,size,output_data);

filename droplist temp;
data _null_;
  set &amp;amp;input_list end=eof;
  where counter &amp;lt;= &amp;amp;size * 1000;
  file droplist lrecl=80 ;
  if _n_=1 then put 'drop ' @;
  put variable @;
  if eof then put ';' ;
run;

data &amp;amp;output_data(compress=yes);
  set &amp;amp;input_data;
%include droplist ;
run;

%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 May 2019 16:00:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/558138#M155737</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-05-12T16:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: SAS: Warning Apparent symbolic reference not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/558184#M155762</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12887"&gt;@ErikLund_Jensen&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've never considered using a single CALL EXECUTE() for anything else than a full run-group. Learned something new &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using what you've posted with my sample data - and it works quite well.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* create sample data */
data have;
  array vv_123456789_123456789_abc_ {20000} $1 (20000*'A');
  set sashelp.class;
run;

data vars_to_drop(drop=_:);
  length variable $32;
  do _i=1 to 9999, 10001 to 20000;
    variable=cats('vv_123456789_123456789_abc_',put(_i,f5.));
    output;
  end;
  stop;
run;

%macro extract(input_data, input_list, output_data);
  data _null_;
    set &amp;amp;input_list end=eof;
    if _N_ = 1 then
      call execute("data &amp;amp;output_data; set &amp;amp;input_data(drop=");
    call execute(variable);
    if eof then
      call execute("); run;");
  run;
%mend;
%extract(have, vars_to_drop, want);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 04:27:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Warning-Apparent-symbolic-reference-not-resolved/m-p/558184#M155762</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-05-13T04:27:30Z</dc:date>
    </item>
  </channel>
</rss>

