<?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: Proc compare in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392255#M94365</link>
    <description>&lt;P&gt;You put it outside of your loop, it needs to be inside the loop.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 31 Aug 2017 15:42:54 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-08-31T15:42:54Z</dc:date>
    <item>
      <title>Proc compare</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392218#M94343</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have two Libraries.Production and QC.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Number of dataset in both libraries vary as per project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to run proc compare on both libs and create common dataset which reflects the status as per value of sysinfo -automatic macro variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%MACRO CHECK;&lt;BR /&gt;proc sql;&lt;BR /&gt;select count(distinct(memname)) into :cnt from dictionary.columns&lt;BR /&gt;where libname="prod";&lt;BR /&gt;QUIT;&lt;BR /&gt;%LET cnt=&amp;amp;cnt;&lt;BR /&gt;PROC SQL;&lt;BR /&gt;select distinct(memname) into: name1 -:name&amp;amp;cnt&lt;BR /&gt;from dictionary.columns&lt;BR /&gt;where libname="qc";&lt;BR /&gt;quit;&lt;BR /&gt;%do i=1 %to &amp;amp;cnt;&lt;BR /&gt;proc compare base=prod.&amp;amp;&amp;amp;name&amp;amp;cnt compare=qc.&amp;amp;&amp;amp;name&amp;amp;cnt;&lt;BR /&gt;run;&lt;BR /&gt;%let CompareSysinfo=&amp;amp;sysinfo;&lt;/P&gt;&lt;P&gt;DATA new;&lt;BR /&gt;length item $20;&lt;BR /&gt;sysinfo=&amp;amp;CompareSysinfo.;&lt;BR /&gt;item="&amp;amp;&amp;amp;name&amp;amp;cnt";&lt;BR /&gt;output;&lt;/P&gt;&lt;P&gt;run;&lt;BR /&gt;&lt;BR /&gt;%end;&lt;/P&gt;&lt;P&gt;%MEND;&lt;BR /&gt;%CHECK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All proc compare run successfully.Dataset new created to hold value of sysinfo in dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, i want to append all dataset , so that i can pass message for sysinfo and generate report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help on same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajesh&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 14:26:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392218#M94343</guid>
      <dc:creator>draroda</dc:creator>
      <dc:date>2017-08-31T14:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392220#M94344</link>
      <description>&lt;P&gt;just quick update, as i have passed different lib in proc sql.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please consider it as single lib&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 14:27:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392220#M94344</guid>
      <dc:creator>draroda</dc:creator>
      <dc:date>2017-08-31T14:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392227#M94348</link>
      <description>&lt;P&gt;Add a PROC APPEND statement at the end of hte macro to append the results. You should also drop the table so you don't accidently use it again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc append base=master data=new;
run;

proc sql; 
drop table new;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Aug 2017 14:38:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392227#M94348</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-31T14:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392234#M94350</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried it but it is not holding all records.Only last record appear in append dataset.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 14:52:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392234#M94350</guid>
      <dc:creator>draroda</dc:creator>
      <dc:date>2017-08-31T14:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392236#M94351</link>
      <description>&lt;P&gt;Post your full code.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 14:55:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392236#M94351</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-31T14:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392254#M94364</link>
      <description>&lt;P&gt;%MACRO CHECK;&lt;BR /&gt;proc sql;&lt;BR /&gt;select count(distinct(memname)) into :cnt from dictionary.columns&lt;BR /&gt;where libname="prod";&lt;BR /&gt;QUIT;&lt;BR /&gt;%LET cnt=&amp;amp;cnt;&lt;BR /&gt;PROC SQL;&lt;BR /&gt;select distinct(memname) into: name1 -:name&amp;amp;cnt&lt;BR /&gt;from dictionary.columns&lt;BR /&gt;where libname="qc";&lt;BR /&gt;quit;&lt;BR /&gt;%do i=1 %to &amp;amp;cnt;&lt;BR /&gt;proc compare base=prod.&amp;amp;&amp;amp;name&amp;amp;cnt compare=qc.&amp;amp;&amp;amp;name&amp;amp;cnt;&lt;BR /&gt;run;&lt;BR /&gt;%let CompareSysinfo=&amp;amp;sysinfo;&lt;/P&gt;&lt;P&gt;DATA new;&lt;BR /&gt;length item $20;&lt;BR /&gt;sysinfo=&amp;amp;CompareSysinfo.;&lt;BR /&gt;item="&amp;amp;&amp;amp;name&amp;amp;cnt";&lt;BR /&gt;output;&lt;/P&gt;&lt;P&gt;run;&lt;BR /&gt;&lt;BR /&gt;%end;&lt;/P&gt;&lt;P&gt;proc append base=master data=new;run;&lt;/P&gt;&lt;P&gt;%MEND;&lt;BR /&gt;%CHECK;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 15:40:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392254#M94364</guid>
      <dc:creator>draroda</dc:creator>
      <dc:date>2017-08-31T15:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392255#M94365</link>
      <description>&lt;P&gt;You put it outside of your loop, it needs to be inside the loop.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 15:42:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392255#M94365</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-31T15:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392414#M94412</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In put it inside the loop and now it write the records equal to number of datasets in library but the observation is repeating from last dataset only.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2017 03:49:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392414#M94412</guid>
      <dc:creator>draroda</dc:creator>
      <dc:date>2017-09-01T03:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392423#M94415</link>
      <description>&lt;P&gt;Run your full program with the options below and post the log. You didn't include the SQL code I suggested either which prevents mistakes from occurring.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Options symbolgen mprint mlogic;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Sep 2017 04:15:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392423#M94415</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-09-01T04:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392850#M94576</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for suggesting to turn on debg options.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have done it and replaced &amp;amp;cnt with &amp;amp;i after do loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rest of the program remain same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajesh&lt;/P&gt;</description>
      <pubDate>Sun, 03 Sep 2017 08:10:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-compare/m-p/392850#M94576</guid>
      <dc:creator>draroda</dc:creator>
      <dc:date>2017-09-03T08:10:49Z</dc:date>
    </item>
  </channel>
</rss>

