<?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 Macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/696299#M212651</link>
    <description>&lt;P&gt;You drop variables not data sets. Drop the drop statement that names data sets.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Nov 2020 19:11:39 GMT</pubDate>
    <dc:creator>WarrenKuhfeld</dc:creator>
    <dc:date>2020-11-03T19:11:39Z</dc:date>
    <item>
      <title>SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/696296#M212649</link>
      <description>&lt;P&gt;I have the following SAS code in a macro. I have i=1 to 34 and j=1 to 3 data sets that I am setting to&amp;nbsp;&amp;nbsp;Xall_final&amp;amp;i._&amp;amp;j.&amp;nbsp; I want to drop all data sets xafin&amp;amp;i._1,&amp;nbsp;xbfin&amp;amp;i._1, and&amp;nbsp;xcfin&amp;amp;i._1. That is all data sets in which j=1. I don't get an error but get this in the log.&lt;/P&gt;
&lt;P&gt;WARNING: The variable xafin34_1 in the DROP, KEEP, or RENAME list has never been referenced.&lt;BR /&gt;WARNING: The variable xbfin34_1 in the DROP, KEEP, or RENAME list has never been referenced.&lt;BR /&gt;WARNING: The variable xcfin34_1 in the DROP, KEEP, or RENAME list has never been referenced.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can someone tell me why I get this message and how should I properly reference the data sets xafin&amp;amp;i_1 that I want to drop?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data Xall_final&amp;amp;i._&amp;amp;j;
set  Xafin&amp;amp;i._&amp;amp;j Xbfin&amp;amp;i._&amp;amp;j  Xcfin&amp;amp;i._&amp;amp;j;
drop xafin&amp;amp;i._1  xbfin&amp;amp;i._1  xcfin&amp;amp;i._1;
/*drop subn2-subn34;
drop sub1 subj2-subj34;*/

*Label an1='Param';
run;&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 18:55:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/696296#M212649</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2020-11-03T18:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/696299#M212651</link>
      <description>&lt;P&gt;You drop variables not data sets. Drop the drop statement that names data sets.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 19:11:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/696299#M212651</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2020-11-03T19:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/696312#M212658</link>
      <description>If you want to drop all you can list or wild card them instead of knowing each index. Or are you trying to selectively drop data sets/variables?</description>
      <pubDate>Tue, 03 Nov 2020 20:05:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/696312#M212658</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-11-03T20:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/696319#M212662</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/44100"&gt;@jacksonan123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have the following SAS code in a macro. I have i=1 to 34 and j=1 to 3 data sets that I am setting to&amp;nbsp;&amp;nbsp;Xall_final&amp;amp;i._&amp;amp;j.&amp;nbsp; I want to drop all data sets xafin&amp;amp;i._1,&amp;nbsp;xbfin&amp;amp;i._1, and&amp;nbsp;xcfin&amp;amp;i._1. That is all data sets in which j=1. I don't get an error but get this in the log.&lt;/P&gt;
&lt;P&gt;WARNING: The variable xafin34_1 in the DROP, KEEP, or RENAME list has never been referenced.&lt;BR /&gt;WARNING: The variable xbfin34_1 in the DROP, KEEP, or RENAME list has never been referenced.&lt;BR /&gt;WARNING: The variable xcfin34_1 in the DROP, KEEP, or RENAME list has never been referenced.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can someone tell me why I get this message and how should I properly reference the data sets xafin&amp;amp;i_1 that I want to drop?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data Xall_final&amp;amp;i._&amp;amp;j;
set  Xafin&amp;amp;i._&amp;amp;j Xbfin&amp;amp;i._&amp;amp;j  Xcfin&amp;amp;i._&amp;amp;j;
drop xafin&amp;amp;i._1  xbfin&amp;amp;i._1  xcfin&amp;amp;i._1;
/*drop subn2-subn34;
drop sub1 subj2-subj34;*/

*Label an1='Param';
run;&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Where is the code that worked to do what you need before starting to write the macro? That should always be the first step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And since SET combines data sets, what do you mean by "drop" a data set that appears on a SET statement?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 20:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/696319#M212662</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-03T20:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/696430#M212719</link>
      <description>&lt;P&gt;As pointed out it was a mistake on my part to try and drop a data set.&amp;nbsp; The issue was resolved by having the original macro to start at 2 instead of 1:&lt;/P&gt;
&lt;P&gt;(%macro bootr;&lt;/P&gt;
&lt;P&gt;%do i=1% to 34;&lt;/P&gt;
&lt;P&gt;%do j=2% to 10;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 10:17:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/696430#M212719</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2020-11-04T10:17:45Z</dc:date>
    </item>
  </channel>
</rss>

