<?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: Finding the same values in many datasets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/661874#M197807</link>
    <description>&lt;P&gt;Are these data sets supposed to have the data in the same column order, which might happen when read from an external source with the same order?&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jun 2020 18:31:30 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-06-17T18:31:30Z</dc:date>
    <item>
      <title>values in many datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/661864#M197803</link>
      <description />
      <pubDate>Thu, 18 Jun 2020 13:03:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/661864#M197803</guid>
      <dc:creator>Emma8</dc:creator>
      <dc:date>2020-06-18T13:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the same values in many datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/661866#M197804</link>
      <description>&lt;P&gt;You talk about "values" but you seem to be implying it is the variable names that is of concern. Could you please clarify?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is variable names, PROC CONTENTS ought to be able to show you what the variable names and then you can compare across data sets.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 18:16:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/661866#M197804</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-06-17T18:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the same values in many datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/661874#M197807</link>
      <description>&lt;P&gt;Are these data sets supposed to have the data in the same column order, which might happen when read from an external source with the same order?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 18:31:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/661874#M197807</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-17T18:31:30Z</dc:date>
    </item>
    <item>
      <title>values in many datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/661876#M197809</link>
      <description />
      <pubDate>Thu, 18 Jun 2020 13:01:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/661876#M197809</guid>
      <dc:creator>Emma8</dc:creator>
      <dc:date>2020-06-18T13:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the same values in many datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/661898#M197817</link>
      <description>&lt;P&gt;I'm afraid you can't avoid hard work.&lt;/P&gt;
&lt;P&gt;First, check which variables from main data seem to fit which variables from any other data.&lt;/P&gt;
&lt;P&gt;Suppose you have common ID and varM of main data seem to fit var2 from data2 and Var3 from data3, then I think that next code can help you decide are the values the same or not:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* assumed all data sorted by ID */
data to_check;
   marge dataM (keep=ID varM)
              data2  (keep=ID var2)
              data3  (keep=ID var3)
     ;
   by ID;
        flag2 = (varM = var2);  /* flag is 1 for true, 0 for false */
        flag3 = (varM = var3);
run;
proc freq data=to_check;
      table flag2 flag3 / nopercent;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 19:38:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/661898#M197817</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-06-17T19:38:10Z</dc:date>
    </item>
    <item>
      <title>values in many datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/661904#M197819</link>
      <description />
      <pubDate>Thu, 18 Jun 2020 13:03:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/661904#M197819</guid>
      <dc:creator>Emma8</dc:creator>
      <dc:date>2020-06-18T13:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the same values in many datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/661911#M197821</link>
      <description>&lt;P&gt;Sounds like you need solve this problem bit by bit instead of trying to attack all in one fell swoop.&lt;/P&gt;
&lt;P&gt;Start by explaining the issue more clearly.&amp;nbsp; Use concrete examples with just a few variables and a few observations.&amp;nbsp; You can make up the data from scratch or select a few representative examples from your real data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some questions to help figure out what you issue really is.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Do you not know how creatively they changed the names of the variables and are looking for ways to check which variable names might refer to the same type of information?&amp;nbsp; For example does AGE in DATA1 contain the same type of information as AGE_AT_ONSET in DATA2?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Use PROC CONTENTS (or query DICTIONARY.COLUMNS or SASHELP.VCOLUMN) to get a list of all of the variables and check for similar variable names and types.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Do you actually know the variable names in the different datasets and are looking to compare the values? For example are you asking how to compare values of AGE in DATA1 with values of AGE_AT_ONSET in DATA2?&amp;nbsp; Do you know how to match the observations between the datasets?&lt;BR /&gt;&lt;/EM&gt;Use PROC COMPARE.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc compare data=data1 compare=data2;
  id id visit ;
  var age;
  with age_at_onset;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 20:38:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/661911#M197821</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-06-17T20:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the same values in many datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/661960#M197849</link>
      <description>&lt;P&gt;1) Avoid merge many to many by extending ID into several variables like -&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; ID_number&amp;nbsp; visit_date department (or a like) - until you get unique key.&lt;/P&gt;
&lt;P&gt;2) While proc compare is limited to compare two datasets in a time, you can compare&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; all datasets with all fitting couples of variables using your own MERGE code,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;thus creating as many as needed flags within one run&lt;/P&gt;
&lt;P&gt;3) Proc compare creates a long output while proc freq of the flags will show exact amount&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; of equal and non equal values per couple&lt;/P&gt;
&lt;P&gt;4) Use KEEP to keep only those variables needed to be checked and&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; use RENAME to enable comparing and avoiding value overriding in case of&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; same variable names in two or more&amp;nbsp;datasets.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 00:08:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/661960#M197849</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-06-18T00:08:53Z</dc:date>
    </item>
    <item>
      <title>values in many datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/662258#M197855</link>
      <description />
      <pubDate>Thu, 18 Jun 2020 13:02:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/662258#M197855</guid>
      <dc:creator>Emma8</dc:creator>
      <dc:date>2020-06-18T13:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the same values in many datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/662636#M197861</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/294547"&gt;@Emma8&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I have more than 2 datasets. How can do proc compare?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You have to write each proc compare step, because - as you have said earlier - the variable-names are different. Creating lookup-dataset would open the possibility to generate the code, but i would waste time for that only, if i had to do such things regularly.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 05:25:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/values-in-many-datasets/m-p/662636#M197861</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-06-18T05:25:43Z</dc:date>
    </item>
  </channel>
</rss>

