<?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: Drop variables from comparison using a macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Drop-variables-from-comparison-using-a-macro/m-p/797530#M313548</link>
    <description>Take a look at the global option DKRICOND=</description>
    <pubDate>Mon, 21 Feb 2022 03:24:34 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2022-02-21T03:24:34Z</dc:date>
    <item>
      <title>Drop variables from comparison using a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Drop-variables-from-comparison-using-a-macro/m-p/797524#M313545</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let lpremig=;
%let lpostmig=;

libname premig "&amp;amp;lpremig";
libname postmig "&amp;amp;lpostmig";
option nodate pageno=1 linesize=80 pagesize=40;

%macro Compds (dsview);
Proc sort data=premig.&amp;amp;dsview out= &amp;amp;dsview.pre;
By id;
Run;

Proc sort data=postmig.&amp;amp;dsview  out=&amp;amp;dsview.post;
By id;
Run;

Proc compare base=&amp;amp;dsview.pre compare=&amp;amp;dsview.post (drop=a b c d e f g) ; 
run;

 %mend compds;

 %compds(A);
 %compds(B);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I am trying to eliminate a few variables from a comparison in the above macro, however, the variables in the drop statement are not available in all datasets.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If need to run both A and B reports together and eliminate a few variables without an&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: The variable b c in the DROP, KEEP, or RENAME list has never been &lt;BR /&gt;referenced.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I dont want to change the variable names every now and then since I know I have a set of variables to be eliminated from few datasets.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need a single report with all datasets comparison by eliminating the set of variables where ever applicable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please advise, how to achieve this.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 02:30:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Drop-variables-from-comparison-using-a-macro/m-p/797524#M313545</guid>
      <dc:creator>bharath86</dc:creator>
      <dc:date>2022-02-21T02:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Drop variables from comparison using a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Drop-variables-from-comparison-using-a-macro/m-p/797530#M313548</link>
      <description>Take a look at the global option DKRICOND=</description>
      <pubDate>Mon, 21 Feb 2022 03:24:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Drop-variables-from-comparison-using-a-macro/m-p/797530#M313548</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2022-02-21T03:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Drop variables from comparison using a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Drop-variables-from-comparison-using-a-macro/m-p/797534#M313552</link>
      <description>Excellent, learned something new today.</description>
      <pubDate>Mon, 21 Feb 2022 04:05:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Drop-variables-from-comparison-using-a-macro/m-p/797534#M313552</guid>
      <dc:creator>bharath86</dc:creator>
      <dc:date>2022-02-21T04:05:49Z</dc:date>
    </item>
  </channel>
</rss>

