<?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: Creating a report of data that is NOT in the dataset. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-report-of-data-that-is-NOT-in-the-dataset/m-p/364280#M86377</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input p $ y d : dollar.;
cards;
Product1 1999 $566
Product1 2000 $500
Product2 1998 $700
Product2 2000 $400
Product3 1998 $300
;
run;
data temp;
 y=1998;output;
 y=1999;output;
run;
proc sql;
create table want as
 select distinct a.p,a.y
  from (
select * from
(select distinct p from have),
(select y from temp)
) as a left join have as b
on a.p=b.p and a.y=b.y 
where d is missing;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 05 Jun 2017 14:31:27 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2017-06-05T14:31:27Z</dc:date>
    <item>
      <title>Creating a report of data that is NOT in the dataset.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-report-of-data-that-is-NOT-in-the-dataset/m-p/364158#M86325</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to SAS, and am struggling with a particular question and would just like to be pointed in the right direction.&lt;/P&gt;&lt;P&gt;I have a dataset of multiple product listings and their costs per year. So for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Product 1 1999 $566&lt;/P&gt;&lt;P&gt;Product 1 2000 $500&lt;/P&gt;&lt;P&gt;Product 2 1998 $700&lt;/P&gt;&lt;P&gt;Product 2 2000 $400&lt;/P&gt;&lt;P&gt;Product 3 1998 $300&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to be able to print a list of all the products that don't have a price for the year 1998 and 1999. So since the data doesn't exist in the dataset, it needs to be created without manually adding in the data. The result needs to look something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1998 Product 1&lt;/P&gt;&lt;P&gt;1999 Product 2, Product 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully this makes sense. I would appreciate any and all feedback! I'm not even sure how to begin with listing data or referencing rows that essentially don't exist. Keep in mind, this is a small example and that the dataset I'm working on has 100s of rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jun 2017 20:55:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-report-of-data-that-is-NOT-in-the-dataset/m-p/364158#M86325</guid>
      <dc:creator>buffalol</dc:creator>
      <dc:date>2017-06-04T20:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a report of data that is NOT in the dataset.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-report-of-data-that-is-NOT-in-the-dataset/m-p/364159#M86326</link>
      <description>&lt;P&gt;You can create a data set with all possible combinations of product and year.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, you can use either PROC SQL or a data step merge to identify which rows of the all possible combinations data set do not match a row in your actual data set.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jun 2017 21:05:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-report-of-data-that-is-NOT-in-the-dataset/m-p/364159#M86326</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-06-04T21:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a report of data that is NOT in the dataset.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-report-of-data-that-is-NOT-in-the-dataset/m-p/364161#M86327</link>
      <description>&lt;P&gt;What years are you interested in? What products?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Either way, search PRELOADFMT that shows a way to get all possible combinations and building the table you want. This is a pretty common question on here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jun 2017 21:08:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-report-of-data-that-is-NOT-in-the-dataset/m-p/364161#M86327</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-04T21:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a report of data that is NOT in the dataset.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-report-of-data-that-is-NOT-in-the-dataset/m-p/364163#M86328</link>
      <description>&lt;P&gt;If you know that each year and product is recorded at least once in the data set somewhere&amp;nbsp;you can use the SPARSE option in PROC FREQ.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example with PROC FREQ.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=sashelp.class noprint;
table sex*age /out = want (where=(count=0)) sparse nopercent;
run;

proc print data=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jun 2017 21:16:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-report-of-data-that-is-NOT-in-the-dataset/m-p/364163#M86328</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-04T21:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a report of data that is NOT in the dataset.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-report-of-data-that-is-NOT-in-the-dataset/m-p/364280#M86377</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input p $ y d : dollar.;
cards;
Product1 1999 $566
Product1 2000 $500
Product2 1998 $700
Product2 2000 $400
Product3 1998 $300
;
run;
data temp;
 y=1998;output;
 y=1999;output;
run;
proc sql;
create table want as
 select distinct a.p,a.y
  from (
select * from
(select distinct p from have),
(select y from temp)
) as a left join have as b
on a.p=b.p and a.y=b.y 
where d is missing;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Jun 2017 14:31:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-report-of-data-that-is-NOT-in-the-dataset/m-p/364280#M86377</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-06-05T14:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a report of data that is NOT in the dataset.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-report-of-data-that-is-NOT-in-the-dataset/m-p/366077#M87033</link>
      <description>&lt;P&gt;This really helped and put me on the right track. Thank you so much!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 07:58:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-report-of-data-that-is-NOT-in-the-dataset/m-p/366077#M87033</guid>
      <dc:creator>buffalol</dc:creator>
      <dc:date>2017-06-12T07:58:48Z</dc:date>
    </item>
  </channel>
</rss>

