<?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 create new dataset from existing datasets with certain conditions in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-new-dataset-from-existing-datasets-with-certain/m-p/334829#M22265</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where libname=upcase("arch") and input(scan(memname,-1,'_') ,best8.) gt 2015&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 22 Feb 2017 02:38:36 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2017-02-22T02:38:36Z</dc:date>
    <item>
      <title>How to create new dataset from existing datasets with certain conditions</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-new-dataset-from-existing-datasets-with-certain/m-p/334671#M22259</link>
      <description>&lt;P&gt;I use SAS E.G. version 4.3.&lt;/P&gt;&lt;P&gt;There are&amp;nbsp;datasets (in a folder called archive) where the names are something&amp;nbsp;like this: "table_contents_[year]", where [year] = 2012, 2013, 2014, ...&lt;/P&gt;&lt;P&gt;For example:&amp;nbsp;&lt;SPAN&gt;table_&lt;/SPAN&gt;&lt;SPAN&gt;contents&lt;/SPAN&gt;&lt;SPAN&gt;_2012, table_contents_2013, ...,&amp;nbsp;table_contents_2016.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;One of the variables of these datasets is a date variable that contains dates for that certain year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to put the data from these datasets into one new dataset, but selecting only data as from a certain year or a certain date. How can I do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the statement below, I can extract and put the data from ALL datasets with name "&lt;SPAN&gt;table&lt;/SPAN&gt;&lt;SPAN&gt;contents&lt;/SPAN&gt;&lt;SPAN&gt;_[year]" into a new dataset.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But I don't know how I can select data&amp;nbsp;that are for example greater than or equal to year&amp;nbsp;2015 or 10SEP2015?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let listOfDataTables&amp;nbsp;=;

proc sql noprint;
select compress("arch." || memname)
into :listOfDataTables separated by ' ' 
from sashelp.vtable
where libname=upcase("arch") and upcase(memname) like 'tablecontents*_%' escape '*';
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2017 15:05:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-new-dataset-from-existing-datasets-with-certain/m-p/334671#M22259</guid>
      <dc:creator>Illuminosa</dc:creator>
      <dc:date>2017-02-21T15:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to create new dataset from existing datasets with certain conditions</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-new-dataset-from-existing-datasets-with-certain/m-p/334684#M22260</link>
      <description>&lt;P&gt;First, its not a good idea to split same data up into multiplpe datasets, this just makes your life harder. &amp;nbsp;Set all your data together and have year as a column:&lt;/P&gt;
&lt;PRE&gt;data want;
  length v $50;
  set table_contents_: indsname=tmp;
  v=tmp;
run;&lt;/PRE&gt;
&lt;P&gt;You can process indsname to get year. &amp;nbsp;You can then simply where clause this one dataset rather than trying to loop over many.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2017 15:24:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-new-dataset-from-existing-datasets-with-certain/m-p/334684#M22260</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-02-21T15:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to create new dataset from existing datasets with certain conditions</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-new-dataset-from-existing-datasets-with-certain/m-p/334829#M22265</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where libname=upcase("arch") and input(scan(memname,-1,'_') ,best8.) gt 2015&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Feb 2017 02:38:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-new-dataset-from-existing-datasets-with-certain/m-p/334829#M22265</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-02-22T02:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to create new dataset from existing datasets with certain conditions</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-new-dataset-from-existing-datasets-with-certain/m-p/335209#M22277</link>
      <description>&lt;P&gt;This works. Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 07:42:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-new-dataset-from-existing-datasets-with-certain/m-p/335209#M22277</guid>
      <dc:creator>Illuminosa</dc:creator>
      <dc:date>2017-02-23T07:42:58Z</dc:date>
    </item>
  </channel>
</rss>

