<?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 beginner question for the group in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sas-beginner-question-for-the-group/m-p/6847#M2198</link>
    <description>I'm not sure why you are trying to do this directly in code.  If you are using EGuide (the topic of this group), the compare task is under the data tab.  It leads you through it and sorts and sets up the keys for you.</description>
    <pubDate>Fri, 08 Feb 2008 02:46:30 GMT</pubDate>
    <dc:creator>Doc_Duke</dc:creator>
    <dc:date>2008-02-08T02:46:30Z</dc:date>
    <item>
      <title>Sas beginner question for the group</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sas-beginner-question-for-the-group/m-p/6845#M2196</link>
      <description>Hi,&lt;BR /&gt;
    NE Washington DC newbie user here.  Tried using manuals and online help and just a little lost.  I am trying to use the proc compare command to compare the data in two tables.  However, the two tables of data appear to be sorted differently.&lt;BR /&gt;
&lt;BR /&gt;
   Thus the delimma how to write a query that will order the data in away that I can compare to tables.&lt;BR /&gt;
&lt;BR /&gt;
   The query.&lt;BR /&gt;
&lt;BR /&gt;
 libname xdata 'c:\SAS_Testing\ndprod3';&lt;BR /&gt;
&lt;BR /&gt;
proc compare data=xdata.county_msa compare=xdata.county_msa1 ;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sql;&lt;BR /&gt;
	select * from xdata.county_msa&lt;BR /&gt;
	where state_fips = '72'&lt;BR /&gt;
	order by cnty;&lt;BR /&gt;
	quit;&lt;BR /&gt;
&lt;BR /&gt;
   The results.&lt;BR /&gt;
&lt;BR /&gt;
  The COMPARE Procedure&lt;BR /&gt;
                      Comparison of XDATA.COUNTY_MSA with XDATA.COUNTY_MSA1&lt;BR /&gt;
                                         (Method=EXACT)&lt;BR /&gt;
&lt;BR /&gt;
                                        Data Set Summary&lt;BR /&gt;
&lt;BR /&gt;
               Dataset                     Created          Modified  NVar    NObs&lt;BR /&gt;
&lt;BR /&gt;
               XDATA.COUNTY_MSA   04FEB08:14:53:42  04FEB08:14:53:58    12  970599&lt;BR /&gt;
               XDATA.COUNTY_MSA1  07FEB08:11:31:27  07FEB08:11:31:27    12  970599&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
                                        Variables Summary&lt;BR /&gt;
&lt;BR /&gt;
                       Number of Variables in Common: 12.&lt;BR /&gt;
                       Number of Variables with Differing Attributes: 12.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
                             Value Comparison Results for Variables&lt;BR /&gt;
&lt;BR /&gt;
                   __________________________________________________________&lt;BR /&gt;
                              ||  state_fips&lt;BR /&gt;
                              ||  Base Value           Compare Value&lt;BR /&gt;
                          Obs ||  state_fips            state_fips&lt;BR /&gt;
                    ________  ||  __                    __&lt;BR /&gt;
                              ||&lt;BR /&gt;
                           1  ||  01                    48&lt;BR /&gt;
                           2  ||  01                    48&lt;BR /&gt;
                           3  ||  01                    48&lt;BR /&gt;
                           4  ||  01                    48&lt;BR /&gt;
                           5  ||  01                    48&lt;BR /&gt;
                           6  ||  01                    48&lt;BR /&gt;
                           7  ||  01                    48&lt;BR /&gt;
                           8  ||  01                    48&lt;BR /&gt;
                           9  ||  01                    48&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
                   __________________________________________________________&lt;BR /&gt;
                              ||  cnty&lt;BR /&gt;
                              ||  Base Value           Compare Value&lt;BR /&gt;
                          Obs ||  cnty                  cnty&lt;BR /&gt;
                    ________  ||  ___                   ___&lt;BR /&gt;
                              ||&lt;BR /&gt;
                           1  ||  001                   059&lt;BR /&gt;
                           2  ||  001                   059&lt;BR /&gt;
                           3  ||  001                   059&lt;BR /&gt;
                           4  ||  001                   059&lt;BR /&gt;
                           5  ||  001                   059&lt;BR /&gt;
                           6  ||  001                   059&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Any help would be greatly appreciated.&lt;BR /&gt;
Thanks&lt;BR /&gt;
Alienographer</description>
      <pubDate>Thu, 07 Feb 2008 19:47:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sas-beginner-question-for-the-group/m-p/6845#M2196</guid>
      <dc:creator>alienographer</dc:creator>
      <dc:date>2008-02-07T19:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Sas beginner question for the group</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sas-beginner-question-for-the-group/m-p/6846#M2197</link>
      <description>SAS is a JIT compiled language.  It reads of code block, compiles it, and then executes it.  &lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
Proc Compare ...;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Is a textual block that is compiled to machine code and then executed.&lt;BR /&gt;
&lt;BR /&gt;
next &lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
Proc Sql;&lt;BR /&gt;
 Select ....;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
is compiled and executed.&lt;BR /&gt;
&lt;BR /&gt;
If you wanted to use compare the sorted files, you need to&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sort data=indata1 out=outdata1; by key_value;&lt;BR /&gt;
proc sort data=indata2 out=outdata2; by key_value;&lt;BR /&gt;
&lt;BR /&gt;
proc compare data=outdata1 compare=outdata2;&lt;BR /&gt;
run;&lt;BR /&gt;
quit;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Or to use proc sql&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sql;&lt;BR /&gt;
  create table outdata1 as&lt;BR /&gt;
  select * from ... where ... order by ... ;&lt;BR /&gt;
&lt;BR /&gt;
  create table outdata2 as&lt;BR /&gt;
  select * from ... where ... order by ... ;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
proc compare ... ;&lt;BR /&gt;
run;&lt;BR /&gt;
quit;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 07 Feb 2008 20:15:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sas-beginner-question-for-the-group/m-p/6846#M2197</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-02-07T20:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: Sas beginner question for the group</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sas-beginner-question-for-the-group/m-p/6847#M2198</link>
      <description>I'm not sure why you are trying to do this directly in code.  If you are using EGuide (the topic of this group), the compare task is under the data tab.  It leads you through it and sorts and sets up the keys for you.</description>
      <pubDate>Fri, 08 Feb 2008 02:46:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sas-beginner-question-for-the-group/m-p/6847#M2198</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2008-02-08T02:46:30Z</dc:date>
    </item>
  </channel>
</rss>

