<?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: Program to extract data from multiple datasets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519360#M140658</link>
    <description>&lt;P&gt;I ran the code as below and could see the missing values for the variables crdate, modate,nobs. Could this be due DB2 tables registered in SAS?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  create table work.status as
  select *
  from dictionary.tables
  where libname='DB2CRFS' ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Sample output:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="645"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="61"&gt;libname&lt;/TD&gt;
&lt;TD width="136"&gt;memname&lt;/TD&gt;
&lt;TD width="64"&gt;memtype&lt;/TD&gt;
&lt;TD width="64"&gt;dbms_memtype&lt;/TD&gt;
&lt;TD width="64"&gt;memlabel&lt;/TD&gt;
&lt;TD width="64"&gt;typemem&lt;/TD&gt;
&lt;TD width="64"&gt;crdate&lt;/TD&gt;
&lt;TD width="64"&gt;modate&lt;/TD&gt;
&lt;TD width="64"&gt;nobs&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;DB2CRFS&lt;/TD&gt;
&lt;TD&gt;DEMSY_CODETABLES&lt;/TD&gt;
&lt;TD&gt;DATA&lt;/TD&gt;
&lt;TD&gt;TABLE&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;DATA&lt;/TD&gt;
&lt;TD&gt;.&lt;/TD&gt;
&lt;TD&gt;.&lt;/TD&gt;
&lt;TD&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
    <pubDate>Fri, 07 Dec 2018 04:55:56 GMT</pubDate>
    <dc:creator>Babloo</dc:creator>
    <dc:date>2018-12-07T04:55:56Z</dc:date>
    <item>
      <title>Program to extract data from multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519114#M140559</link>
      <description>&lt;P&gt;I've 20 datasets in one library. Everyday I'm opening that dataset and used to check the no.of observations and whether the dataset is updated with current timestamp. Those datasets were everyday replaced with new data based on other input datasets. Is there a way to write a program to do this validation and generate the output as follows? Incase if any of those datasets (or all) are not updated with current date then I want the email to trigger. Appericiate if someone of you help me here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="409"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="112"&gt;Dataset&lt;/TD&gt;
&lt;TD width="149"&gt;No_of_obs&lt;/TD&gt;
&lt;TD width="148"&gt;X_current_date&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Employee&lt;/TD&gt;
&lt;TD&gt;12568&lt;/TD&gt;
&lt;TD&gt;6-Dec-18&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Marketing&lt;/TD&gt;
&lt;TD&gt;12578&lt;/TD&gt;
&lt;TD&gt;6-Dec-18&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Finanace&lt;/TD&gt;
&lt;TD&gt;32568&lt;/TD&gt;
&lt;TD&gt;6-Dec-18&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Thu, 06 Dec 2018 13:45:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519114#M140559</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-12-06T13:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Program to extract data from multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519117#M140560</link>
      <description>&lt;P&gt;Retrieve the information from dictionary.tables (or sashelp.vtable).&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 13:57:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519117#M140560</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-06T13:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Program to extract data from multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519118#M140561</link>
      <description>How to retrieve the current date variable which was available in each of&lt;BR /&gt;the data set? Value of current date will be same for all the observations&lt;BR /&gt;in each of the dataset.&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Dec 2018 14:01:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519118#M140561</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-12-06T14:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Program to extract data from multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519137#M140567</link>
      <description>&lt;P&gt;As has been mentioned several times before, please post test data for all datasets in the form of a datastep - we are not here to do data entry or guess what needs to be done.&amp;nbsp; Show what should be the output.&amp;nbsp; Show what code you have written so far.&amp;nbsp; Post any errors or warnings you might have.&lt;/P&gt;
&lt;P&gt;All I would say from what you posted is data _null_ step, setting your base dataset, and generating some statements from that would seem to be the way forward.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 14:47:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519137#M140567</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-12-06T14:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Program to extract data from multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519204#M140583</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;How to retrieve the current date variable which was available in each of&lt;BR /&gt;the data set? Value of current date will be same for all the observations&lt;BR /&gt;in each of the dataset.&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Did you check the sashelp data set? Do you have to use the date variable in the file, or is the creation or modified date ok?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please go back and mark some of your previous questions as solved, correctly indicating the solution.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;People have taken a lot of time to assist you on here, and acknowledging that would be appropriate.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 16:29:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519204#M140583</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-06T16:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Program to extract data from multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519216#M140591</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;How to retrieve the current date variable which was available in each of&lt;BR /&gt;the data set? Value of current date will be same for all the observations&lt;BR /&gt;in each of the dataset.&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That was not part of your original question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example to create a data set with the creation and modified dates of the data set for members of a library:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table work.status as
  select libname, memname,crdate, modate, nobs 
  from dictionary.tables
  where libname='WORK' ;
quit;&lt;/PRE&gt;
&lt;P&gt;The LIBNAME is stored in upper case so make sure you use either upcase text or the UPCASE function on the value you use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can modify this to only return likely candidates based on either the CRDATE (creation) or MODATE (modified date) values. These variables are datetime so if you wanted the list of members that were modified on or after a given date something like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table work.status as
  select libname, memname,crdate, modate, nobs 
  from dictionary.tables
  where libname='WORK' and datepart(crdate) &amp;gt; '05DEC2018'd;
quit;
&lt;/PRE&gt;
&lt;P&gt;If your "current date" variable is prior to the date of creation or modification there might be an issue to investigate in the assignment of that variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 17:03:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519216#M140591</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-12-06T17:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Program to extract data from multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519219#M140593</link>
      <description>&lt;P&gt;Please try sashelp.vtable in a data step as below , check the screen shot&lt;/P&gt;
&lt;P&gt;so if you test this code you will get a dataset want with the variables displayed which should help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;for your requirement change the library and keep the required variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;&lt;BR /&gt;set sashelp.vtable;&lt;BR /&gt;where libname='SDTM';&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25441i30F775ABF88EFD35/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 17:18:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519219#M140593</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2018-12-06T17:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Program to extract data from multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519360#M140658</link>
      <description>&lt;P&gt;I ran the code as below and could see the missing values for the variables crdate, modate,nobs. Could this be due DB2 tables registered in SAS?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  create table work.status as
  select *
  from dictionary.tables
  where libname='DB2CRFS' ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Sample output:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="645"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="61"&gt;libname&lt;/TD&gt;
&lt;TD width="136"&gt;memname&lt;/TD&gt;
&lt;TD width="64"&gt;memtype&lt;/TD&gt;
&lt;TD width="64"&gt;dbms_memtype&lt;/TD&gt;
&lt;TD width="64"&gt;memlabel&lt;/TD&gt;
&lt;TD width="64"&gt;typemem&lt;/TD&gt;
&lt;TD width="64"&gt;crdate&lt;/TD&gt;
&lt;TD width="64"&gt;modate&lt;/TD&gt;
&lt;TD width="64"&gt;nobs&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;DB2CRFS&lt;/TD&gt;
&lt;TD&gt;DEMSY_CODETABLES&lt;/TD&gt;
&lt;TD&gt;DATA&lt;/TD&gt;
&lt;TD&gt;TABLE&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;DATA&lt;/TD&gt;
&lt;TD&gt;.&lt;/TD&gt;
&lt;TD&gt;.&lt;/TD&gt;
&lt;TD&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Fri, 07 Dec 2018 04:55:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519360#M140658</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-12-07T04:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Program to extract data from multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519362#M140659</link>
      <description>&lt;P&gt;I tried the following code as well but stil not seeing the values for&amp;nbsp;&lt;SPAN&gt;crdate, modate and nobs.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
	connect to db2 (datasrc=db2gtu
		authdomain=DB2AuthODS 
		connection=global);
	create table work.status as
		select *
			from dictionary.tables
				where libname='DB2CRFS';
	disconnect from db2;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Dec 2018 05:01:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519362#M140659</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-12-07T05:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: Program to extract data from multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519368#M140662</link>
      <description>That’s because you don’t have SAS datasets. You have data on a server which is very very different. Post on the appropriate server forum instead.</description>
      <pubDate>Fri, 07 Dec 2018 05:57:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519368#M140662</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-07T05:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Program to extract data from multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519385#M140667</link>
      <description>&lt;P&gt;Extract the data to SAS, then run that code.&amp;nbsp; Or alternatively passthrough some SQL code to the database which gets the information required and then returns it, maybe something like:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  connect to db2 (...);
  select * from connection to db2 (
    select * from dictionary.tables);
  disconnect from db2;
quit;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Dec 2018 09:16:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-to-extract-data-from-multiple-datasets/m-p/519385#M140667</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-12-07T09:16:20Z</dc:date>
    </item>
  </channel>
</rss>

