<?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: How to report values of a variable from a dataset that are not present in another dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-report-values-of-a-variable-from-a-dataset-that-are-not/m-p/691550#M210497</link>
    <description>&lt;P&gt;Use a hash object.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For code examples, supply example data in usable form (data steps with datalines), so we have something to develop and test against.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Oct 2020 14:38:23 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-10-14T14:38:23Z</dc:date>
    <item>
      <title>How to report values of a variable from a dataset that are not present in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-report-values-of-a-variable-from-a-dataset-that-are-not/m-p/691548#M210495</link>
      <description>How to report values of a variable from a dataset that are not present in another dataset</description>
      <pubDate>Wed, 14 Oct 2020 14:33:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-report-values-of-a-variable-from-a-dataset-that-are-not/m-p/691548#M210495</guid>
      <dc:creator>anshika</dc:creator>
      <dc:date>2020-10-14T14:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to report values of a variable from a dataset that are not present in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-report-values-of-a-variable-from-a-dataset-that-are-not/m-p/691550#M210497</link>
      <description>&lt;P&gt;Use a hash object.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For code examples, supply example data in usable form (data steps with datalines), so we have something to develop and test against.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 14:38:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-report-values-of-a-variable-from-a-dataset-that-are-not/m-p/691550#M210497</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-14T14:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to report values of a variable from a dataset that are not present in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-report-values-of-a-variable-from-a-dataset-that-are-not/m-p/691552#M210499</link>
      <description>&lt;P&gt;If I understand your question, you can use the EXCEPT operator in PROC SQL. It will display values of a variable that are present in the first data set, but not in the second data set. Here is some code to test.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
  input num;
cards;
1
2
3
4
;
run;
data two;
  input num;
cards;
1
2
6
7
;
run;
proc sql;
  select num
    from one
  except
  select num
    from two
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The final result will display 3 and 4.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 14:49:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-report-values-of-a-variable-from-a-dataset-that-are-not/m-p/691552#M210499</guid>
      <dc:creator>KathyKiraly</dc:creator>
      <dc:date>2020-10-14T14:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to report values of a variable from a dataset that are not present in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-report-values-of-a-variable-from-a-dataset-that-are-not/m-p/691560#M210502</link>
      <description>Data file1;&lt;BR /&gt;Set one;&lt;BR /&gt;Input prsnid $ ;&lt;BR /&gt;Datalines;&lt;BR /&gt;11&lt;BR /&gt;12&lt;BR /&gt;13&lt;BR /&gt;14; run;&lt;BR /&gt;&lt;BR /&gt;Data file2;&lt;BR /&gt;Set two&lt;BR /&gt;Input prsnid $ gracedate yymmdd10.;&lt;BR /&gt;Datalines;&lt;BR /&gt;11 2020-12-31&lt;BR /&gt;12 2020-12-31&lt;BR /&gt;14 2020-01-01; run;&lt;BR /&gt;&lt;BR /&gt;I need to report prsnid=13 in excel sheet because that is missing from second dataset</description>
      <pubDate>Wed, 14 Oct 2020 15:02:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-report-values-of-a-variable-from-a-dataset-that-are-not/m-p/691560#M210502</guid>
      <dc:creator>anshika</dc:creator>
      <dc:date>2020-10-14T15:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to report values of a variable from a dataset that are not present in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-report-values-of-a-variable-from-a-dataset-that-are-not/m-p/691561#M210503</link>
      <description>Data file1;&lt;BR /&gt;Set one;&lt;BR /&gt;Input prsnid $ ;&lt;BR /&gt;Datalines;&lt;BR /&gt;11&lt;BR /&gt;12&lt;BR /&gt;13&lt;BR /&gt;14; run;&lt;BR /&gt;&lt;BR /&gt;Data file2;&lt;BR /&gt;Set two&lt;BR /&gt;Input prsnid $ gracedate yymmdd10.;&lt;BR /&gt;Datalines;&lt;BR /&gt;11 2020-12-31&lt;BR /&gt;12 2020-12-31&lt;BR /&gt;14 2020-01-01; run;&lt;BR /&gt;&lt;BR /&gt;I need to report prsnid=13 in excel sheet because that is missing from second dataset</description>
      <pubDate>Wed, 14 Oct 2020 15:04:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-report-values-of-a-variable-from-a-dataset-that-are-not/m-p/691561#M210503</guid>
      <dc:creator>anshika</dc:creator>
      <dc:date>2020-10-14T15:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to report values of a variable from a dataset that are not present in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-report-values-of-a-variable-from-a-dataset-that-are-not/m-p/691562#M210504</link>
      <description>&lt;P&gt;This code will return 13, which is in file1, but not file2.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data file1;
  input prsnid $ ;
datalines;
11
12
13
14
; 
run;

data file2;
 input prsnid $ gracedate yymmdd10.;
datalines;
11 2020-12-31
12 2020-12-31
14 2020-01-01
; 
run;
proc sql;
  select prsnid
    from file1
  except 
  select prsnid
    from file2
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Oct 2020 15:09:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-report-values-of-a-variable-from-a-dataset-that-are-not/m-p/691562#M210504</guid>
      <dc:creator>KathyKiraly</dc:creator>
      <dc:date>2020-10-14T15:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to report values of a variable from a dataset that are not present in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-report-values-of-a-variable-from-a-dataset-that-are-not/m-p/691564#M210506</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data check;
set file1;
if _n_ = 1
then do;
  declare hash f2 (dataset:"file2");
  f2.definekey('prsnid');
  f2.definedone();
end;
if f2.check() ne 0; /* indicates "not found" */
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Oct 2020 15:21:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-report-values-of-a-variable-from-a-dataset-that-are-not/m-p/691564#M210506</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-14T15:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to report values of a variable from a dataset that are not present in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-report-values-of-a-variable-from-a-dataset-that-are-not/m-p/691572#M210510</link>
      <description>Yes this code worked. Thanks.&lt;BR /&gt;But can I use multiple datasets in place of File2?</description>
      <pubDate>Wed, 14 Oct 2020 15:44:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-report-values-of-a-variable-from-a-dataset-that-are-not/m-p/691572#M210510</guid>
      <dc:creator>anshika</dc:creator>
      <dc:date>2020-10-14T15:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to report values of a variable from a dataset that are not present in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-report-values-of-a-variable-from-a-dataset-that-are-not/m-p/691578#M210513</link>
      <description>&lt;P&gt;You can have multiple hash objects in your data step. The limiting factor is the memory available vs. the size of the objects (variable(s) size * number of items + overhead for building the btree).&lt;/P&gt;
&lt;P&gt;Each "lookup" dataset will have its own object with its own methods (f3.check(), f4.check(), and so on).&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 16:12:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-report-values-of-a-variable-from-a-dataset-that-are-not/m-p/691578#M210513</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-14T16:12:03Z</dc:date>
    </item>
  </channel>
</rss>

