<?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 get # of Distinct ID's in all datasets of a library in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713968#M220343</link>
    <description>Yes. They have the same name across all the datasets. The ID is the key variable across all the datasets.</description>
    <pubDate>Mon, 25 Jan 2021 16:40:52 GMT</pubDate>
    <dc:creator>shasank</dc:creator>
    <dc:date>2021-01-25T16:40:52Z</dc:date>
    <item>
      <title>How to get # of Distinct ID's in all datasets of a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713955#M220333</link>
      <description>&lt;P&gt;Hi Community,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted to explore a way to get a # of all the Distinct ID's in all the datasets of a library. The final output should have the list of all the datasets in the library under column A and # of Distinct ID's in Column B. Please share possibilities or approachable logics.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for you time.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 16:16:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713955#M220333</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2021-01-25T16:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to get # of Distinct ID's in all datasets of a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713962#M220337</link>
      <description>&lt;P&gt;What if a data set in the library does not contain the variable ID?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 16:35:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713962#M220337</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-01-25T16:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to get # of Distinct ID's in all datasets of a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713963#M220338</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Find all data sets in a library named PAIGE */
proc sql;
    create table dsnames as select distinct memname from dictionary.tables where libname='PAIGE';
quit;

/* Count distinct IDs in all of these data sets */
data _null_;
    set dsnames;
    length str $ 1024;
    str=cats('proc sql; create table ids as select "' ,memname,'" as memname length=32,count(distinct id) as n from paige.',memname,';quit;');
    str2='proc append base=all new=ids; run;';
    str3='proc delete data=ids; run;';
    call execute(cat(str,str2,str3));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Jan 2021 16:40:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713963#M220338</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-25T16:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to get # of Distinct ID's in all datasets of a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713964#M220339</link>
      <description>&lt;P&gt;First question: Are the ID variables of the same type with&amp;nbsp; the same name and length in each data set?&lt;/P&gt;
&lt;P&gt;Second: How many data sets are we discussing?&lt;/P&gt;
&lt;P&gt;Third: By "distinct" do you really mean "distinct across all data sets" , i.e. if an ID exists in more than one set then only count it once? Which would bring up the question of which data set to count it in.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One approach is to combine all the datasets keeping only the id variable and adding the source data set name using the Indsname option. But if the variables are of different lengths or types this won't work as a simple statement.&lt;/P&gt;
&lt;P&gt;The summarize.&lt;/P&gt;
&lt;P&gt;Something like this:&lt;/P&gt;
&lt;PRE&gt;data work.ids;
   set 
       dataone (keep=id)
       datatwo (keep=id)
       datathree (keep=id)
       indsname=dsname
   ;
   source=dsname;
run;

proc sql;
    
    select source, count(*) as uniqueids
    from (select distinct source,id from work.ids)
    group by source
    ;
run;
&lt;/PRE&gt;
&lt;P&gt;You should be able to test if the logic will work with two or three sets. Obviously your library should be part of the data set name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have have a LOT of data sets let us know.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 16:37:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713964#M220339</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-25T16:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to get # of Distinct ID's in all datasets of a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713966#M220341</link>
      <description>Thank you for your question. If the dataset doesn't have the ID variable then the count could be shown as zero or missing. But, the current library has ID in all the datasets.</description>
      <pubDate>Mon, 25 Jan 2021 16:38:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713966#M220341</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2021-01-25T16:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get # of Distinct ID's in all datasets of a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713967#M220342</link>
      <description>&lt;P&gt;Ok. Do the data sets share some naming convention?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 16:39:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713967#M220342</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-01-25T16:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to get # of Distinct ID's in all datasets of a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713968#M220343</link>
      <description>Yes. They have the same name across all the datasets. The ID is the key variable across all the datasets.</description>
      <pubDate>Mon, 25 Jan 2021 16:40:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713968#M220343</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2021-01-25T16:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to get # of Distinct ID's in all datasets of a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713969#M220344</link>
      <description>&lt;P&gt;Yes but do the actual data sets have similar names, like data1, data2 and so on?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 16:42:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713969#M220344</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-01-25T16:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get # of Distinct ID's in all datasets of a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713971#M220345</link>
      <description>Oh no. They donot have a sequence. They are names differently.</description>
      <pubDate>Mon, 25 Jan 2021 16:43:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713971#M220345</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2021-01-25T16:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to get # of Distinct ID's in all datasets of a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713972#M220346</link>
      <description>Thank you for your reply. The library has around 50 datasets and many more will be added on a weekly basis. So, I was try to see if we could have a way for SAS to get the names of the datasets.</description>
      <pubDate>Mon, 25 Jan 2021 16:45:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713972#M220346</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2021-01-25T16:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get # of Distinct ID's in all datasets of a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713975#M220347</link>
      <description>HI Paige, Thank you for your help. I tried your code and I the dsnames came out as an empty dataset. The log has no errors.</description>
      <pubDate>Mon, 25 Jan 2021 16:49:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713975#M220347</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2021-01-25T16:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to get # of Distinct ID's in all datasets of a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713978#M220349</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/110575"&gt;@shasank&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;HI Paige, Thank you for your help. I tried your code and I the dsnames came out as an empty dataset. The log has no errors.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Show us. Show us the log, and show us the incorrect results.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 17:04:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713978#M220349</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-25T17:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get # of Distinct ID's in all datasets of a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713983#M220350</link>
      <description>&lt;P&gt;Hi Paige,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shasank_0-1611594151618.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53880i9E01970583811839/image-size/medium?v=v2&amp;amp;px=400" role="button" title="shasank_0-1611594151618.png" alt="shasank_0-1611594151618.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shasank_1-1611594291739.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53881i3FC9AE3A39989DA6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="shasank_1-1611594291739.png" alt="shasank_1-1611594291739.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 17:05:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713983#M220350</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2021-01-25T17:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to get # of Distinct ID's in all datasets of a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713984#M220351</link>
      <description>Nev And Labor are 2 libraries I am testing.</description>
      <pubDate>Mon, 25 Jan 2021 17:06:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713984#M220351</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2021-01-25T17:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to get # of Distinct ID's in all datasets of a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713986#M220352</link>
      <description>&lt;P&gt;You didn't answer most of the questions asked by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Those are what drive the solution.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Show us an example of what you have and what you expect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example of generating a HAVE data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data lib1.demo1;
do ID=1 to 20;
x = rand('integer', 12, 45);
output;
end;
run;

data lib1.random1;
do ID=1 to 20;
x = rand('integer', 12, 45);
output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Would the expected results from those tables be 20 or 40?&lt;/P&gt;
&lt;P&gt;What would you expect as the output?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 17:08:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713986#M220352</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-25T17:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to get # of Distinct ID's in all datasets of a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713987#M220353</link>
      <description>&lt;P&gt;Library name must be capital letters:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LABOUR&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 17:09:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713987#M220353</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-25T17:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to get # of Distinct ID's in all datasets of a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713992#M220356</link>
      <description>&lt;P&gt;Thank you. The all caps of Library worked. I am trouble shooting the rest of the code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* Count distinct IDs in all of these data sets */&lt;BR /&gt;data _null_;&lt;BR /&gt;set dsnames;&lt;BR /&gt;length str $ 1024;&lt;BR /&gt;str=cats('proc sql; create table ids as select "' ,memname,'" as memname length=32,count(distinct ptid) as n from Labor.',memname,';quit;');&lt;BR /&gt;str2='proc append base=all new=ids; run;';&lt;BR /&gt;str3='proc delete data=ids; run;';&lt;BR /&gt;call execute(cat(str,str2,str3));&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shasank_0-1611595193048.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53882i49670F3B84B486C9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="shasank_0-1611595193048.png" alt="shasank_0-1611595193048.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 17:20:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713992#M220356</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2021-01-25T17:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to get # of Distinct ID's in all datasets of a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713995#M220357</link>
      <description>&lt;P&gt;From now on, I request that the LOG should be copied as text and pasted into the window that appears when you click on the &amp;lt;/&amp;gt; icon. And please show us the entire log, not selected portions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Was there an existing data set named ALL before you ran this code? If so, change the name ALL in the PROC APPEND code to some data set name that doesn't exist yet.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 17:24:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713995#M220357</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-25T17:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to get # of Distinct ID's in all datasets of a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713997#M220359</link>
      <description>&lt;P&gt;Probably best to add the FORCE option to PROC APPEND.&amp;nbsp; Otherwise PROC APPEND will expect the ALL dataset to already exist.&amp;nbsp;&amp;nbsp;You will probable also want to remove any existing ALL dataset before starting so avoid confusion.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 17:27:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713997#M220359</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-25T17:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to get # of Distinct ID's in all datasets of a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713999#M220361</link>
      <description>&lt;P&gt;You can get a list of the data sets in a library using the sashelp.vtable view or dictionary.table view.&lt;/P&gt;
&lt;P&gt;From there:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Write a macro that counts for one data set and then loop through and do that for all data sets.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Combine all data sets into a view and do a single count&lt;/LI&gt;
&lt;LI&gt;Write a macro and use call execute&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Either way you need to process each data set once. If each data set is being handled uniquely and you can guarantee that each data set will have an ID column that's pretty straightforward. You always start a problem like this by getting it working for one data set and then scaling that to all data sets.&lt;/P&gt;
&lt;P&gt;Here are some tutorials, though I suspect someone will give you an answer with actual code. I'm only providing idea's as per your initial question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UCLA introductory tutorial on macro variables and macros&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Tutorial on converting a working program to a macro&lt;BR /&gt;&lt;BR /&gt;This method is pretty robust and helps prevent errors and makes it much easier to debug your code. Obviously biased, because I wrote it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Examples of common macro usage&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/SAS-9-4-Macro-Language-Reference-Has-a-New-Appendix/ta-p/291716" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/SAS-9-4-Macro-Language-Reference-Has-a-New-Appendix/ta-p/291716&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/110575"&gt;@shasank&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Community,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wanted to explore a way to get a # of all the Distinct ID's in all the datasets of a library. The final output should have the list of all the datasets in the library under column A and # of Distinct ID's in Column B. &lt;STRONG&gt;Please share possibilities or approachable logics.&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for you time.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 17:28:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-of-Distinct-ID-s-in-all-datasets-of-a-library/m-p/713999#M220361</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-25T17:28:45Z</dc:date>
    </item>
  </channel>
</rss>

