<?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 Create a dataset from multiple datasets/criteria in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57482#M16029</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You never responded to my last post, thus the following may be totally irrelevant.&amp;nbsp; However, if not, I think that you are looking for something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname monthly "c:\art\monthly";&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input ID&amp;nbsp;&amp;nbsp;&amp;nbsp; open_date date9.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;123 01may2004&lt;/P&gt;&lt;P&gt;124 16aug2010&lt;/P&gt;&lt;P&gt;244 20jan2009&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;data monthly.may2005;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input ID (open_date current_date) (date9.) x y z;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;123 01may200407may2005 1 2 3&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; data monthly.aug2011;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input ID (open_date current_date) (date9.) x y z;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;124 16aug201012aug2011 4 5 6&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; data monthly.jan2010;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input ID (open_date current_date) (date9.) x y z;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;244 20jan200918jan2010 7 8 9&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select "monthly."||memname&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; into :monthly_files&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; separated by " "&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from dictionary.tables&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where libname="MONTHLY"&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data all_monthly (drop=open_date);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set &amp;amp;monthly_files. INDSNAME=dsn;&lt;/P&gt;&lt;P&gt;&amp;nbsp; fdate=input(scan(dsn,2,"."),monyy7.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; fdate=input(put(intnx('year',open_date,1,'s'),monyy7.),monyy7.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;proc sort data=have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by id fdate;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; proc sort data=all_monthly;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by id fdate;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; merge have (in=ina) all_monthly (in=inb);&lt;/P&gt;&lt;P&gt;&amp;nbsp; by id fdate;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if ina;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Aug 2011 23:14:25 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2011-08-30T23:14:25Z</dc:date>
    <item>
      <title>Create a dataset from multiple datasets/criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57478#M16025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm a SAS programming beginner!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've a got a dataset with a list of ID numbers and dates. I want to&lt;/P&gt;&lt;P&gt;open a different dataset corresponding to the month and year of each ID&lt;/P&gt;&lt;P&gt;opening date + one year on and get some data for each ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example (dataset1)&lt;/P&gt;&lt;P&gt;ID&amp;nbsp;&amp;nbsp;&amp;nbsp; open_date&lt;/P&gt;&lt;P&gt;123&amp;nbsp; 01may2004&lt;/P&gt;&lt;P&gt;124&amp;nbsp; 16aug2010&lt;/P&gt;&lt;P&gt;244&amp;nbsp; 20jan2009&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the end I I want to create a dataset (from a different data set with further additional data) for each of&lt;/P&gt;&lt;P&gt;the ID that has a corresponding open_date + 1 year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; open_date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; current_date&amp;nbsp; additional_data (from dataset2)&lt;/P&gt;&lt;P&gt;123&amp;nbsp;&amp;nbsp;&amp;nbsp; 01may2004&amp;nbsp;&amp;nbsp;&amp;nbsp; 01may2005&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;124&amp;nbsp;&amp;nbsp;&amp;nbsp; 16aug2010&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 16aug2011&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;244&amp;nbsp;&amp;nbsp;&amp;nbsp; 20jan2009&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20jan2010&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess this is similar to a lookup table in excel, but a little stuck in SAS - Hope you can help.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2011 16:30:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57478#M16025</guid>
      <dc:creator>bolore</dc:creator>
      <dc:date>2011-08-30T16:30:25Z</dc:date>
    </item>
    <item>
      <title>Create a dataset from multiple datasets/criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57479#M16026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are they both already SAS datasets?&amp;nbsp; Does the date have to be precisely 1 year apart?&amp;nbsp; What happens if the initial date is February 29th of a given year?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If they are both SAS datasets, and dependent upon the answers for the above questions, then you can merge the two files in either a datastep or proc sql, and control the other factors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whether a datastep will be sufficient will be a function of what kind of match there is between the two files, i.e. one to one, one to many, or many to many.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2011 16:46:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57479#M16026</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-08-30T16:46:22Z</dc:date>
    </item>
    <item>
      <title>Create a dataset from multiple datasets/criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57480#M16027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, they are SAS datasets.&lt;/P&gt;&lt;P&gt;I want to chose the second dataset from lots of possible datasets depending on the ID open date e.g. if opendate is 1aug2010 then open dataset aug2010.&amp;nbsp; The datasets are monthly datasets that I need the data from so single day precision is not required, just month.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2011 17:10:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57480#M16027</guid>
      <dc:creator>bolore</dc:creator>
      <dc:date>2011-08-30T17:10:45Z</dc:date>
    </item>
    <item>
      <title>Create a dataset from multiple datasets/criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57481#M16028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You didn't answer regarding the type of matching that would exist.&amp;nbsp; If it is only one to one, and since you are new to SAS, depending upon the number of records involved (e.g., if it is less than 10 million or so) I, personally, would combine all of the monthly files into one dataset (which you can probably do in a datastep using the filename statement .. possibly with a wild card), sort the resulting and main datasets by ID and month, and then merge then together in a datastep.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you do it with a datastep, you will have to first insure that the two sets of files (let's call them have and wanttomerge) only have one variable that has the same name, namely id.&amp;nbsp; If they do share any other variable names, you can always use the datastep rename option to change the name(s) in the wanttomerge dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Without knowing more about the files one can't write the code for you, but it would probably look something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; merge have (in=ina) wanttomerge (in=inb);&lt;/P&gt;&lt;P&gt;&amp;nbsp; by id;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if ina and month(date) eq month(datefromwanttomerge) and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; year(date)+1 eq year(datefromwanttomerge);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code like that would select all of the records from have, and combine them with records from wanttomerge, where the records exist in wanttomerge that share the same month but are one year later than those in have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;Art&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2011 17:40:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57481#M16028</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-08-30T17:40:45Z</dc:date>
    </item>
    <item>
      <title>Create a dataset from multiple datasets/criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57482#M16029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You never responded to my last post, thus the following may be totally irrelevant.&amp;nbsp; However, if not, I think that you are looking for something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname monthly "c:\art\monthly";&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input ID&amp;nbsp;&amp;nbsp;&amp;nbsp; open_date date9.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;123 01may2004&lt;/P&gt;&lt;P&gt;124 16aug2010&lt;/P&gt;&lt;P&gt;244 20jan2009&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;data monthly.may2005;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input ID (open_date current_date) (date9.) x y z;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;123 01may200407may2005 1 2 3&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; data monthly.aug2011;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input ID (open_date current_date) (date9.) x y z;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;124 16aug201012aug2011 4 5 6&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; data monthly.jan2010;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input ID (open_date current_date) (date9.) x y z;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;244 20jan200918jan2010 7 8 9&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select "monthly."||memname&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; into :monthly_files&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; separated by " "&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from dictionary.tables&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where libname="MONTHLY"&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data all_monthly (drop=open_date);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set &amp;amp;monthly_files. INDSNAME=dsn;&lt;/P&gt;&lt;P&gt;&amp;nbsp; fdate=input(scan(dsn,2,"."),monyy7.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; fdate=input(put(intnx('year',open_date,1,'s'),monyy7.),monyy7.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;proc sort data=have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by id fdate;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; proc sort data=all_monthly;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by id fdate;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; merge have (in=ina) all_monthly (in=inb);&lt;/P&gt;&lt;P&gt;&amp;nbsp; by id fdate;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if ina;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2011 23:14:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57482#M16029</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-08-30T23:14:25Z</dc:date>
    </item>
    <item>
      <title>Create a dataset from multiple datasets/criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57483#M16030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for the late reply I finally found what the problem was, 'bs' is telling sas to read from right to left and I wanted 2nd column from left to right, found it by try and error. Below is the code for reading the correct column (2nd column from the left) But I have no idea what to use if I wanted to read from left to right that's why I've used -32 , I just counted the column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename cc "C:\CDM1\5K\5K_5000obs\5K_5000obs_RIT\IN\dat1.dat";&lt;/P&gt;&lt;P&gt;Data class2_1;&lt;/P&gt;&lt;P&gt;infile cc lrecl=10000 filename=filename;&lt;/P&gt;&lt;P&gt;input;&lt;/P&gt;&lt;P&gt;file2_2=input(scan(_infile_,-32,,'bs'),best12.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2011 00:07:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57483#M16030</guid>
      <dc:creator>R_A_G_</dc:creator>
      <dc:date>2011-08-31T00:07:44Z</dc:date>
    </item>
    <item>
      <title>Create a dataset from multiple datasets/criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57484#M16031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;R.A.G,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You posted your message in response to the wrong thread, but I'll try to answer it anyway since I probably confused the earlier message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I recall you wanted to read the second column.&amp;nbsp; You really only needed to use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;file2_2=input(scan(_infile_,2,,'s'),best12.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Art&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2011 00:27:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57484#M16031</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-08-31T00:27:30Z</dc:date>
    </item>
    <item>
      <title>Create a dataset from multiple datasets/criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57485#M16032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;RG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2011 02:18:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57485#M16032</guid>
      <dc:creator>R_A_G_</dc:creator>
      <dc:date>2011-08-31T02:18:11Z</dc:date>
    </item>
    <item>
      <title>Create a dataset from multiple datasets/criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57486#M16033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Art,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your replies. I have about 10 years worth of data split up&lt;/P&gt;&lt;P&gt;into monthly SAS data files. The files are labelled yyyymm and have&lt;/P&gt;&lt;P&gt;about 1million IDs (rows) and about 125 variables (col) in each&lt;/P&gt;&lt;P&gt;dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to find out information on 80000 IDs which have an open&lt;/P&gt;&lt;P&gt;date variable and is held in a SAS dataset. I want to pull the same&lt;/P&gt;&lt;P&gt;variables for each ID from the monthly tables corresponding to the&lt;/P&gt;&lt;P&gt;table which holds data 1 year on from the open date. The IDs have&lt;/P&gt;&lt;P&gt;different open dates over the 10year period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The matching would be 1 to 1 on the IDs. I want a snapshot of how the&lt;/P&gt;&lt;P&gt;ID is doing after 1 year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I join all the monthly files together, won't this be quite&lt;/P&gt;&lt;P&gt;inefficient? 10x12x1million or 10x12x80000 if I only keep those IDs&lt;/P&gt;&lt;P&gt;I'm interested in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Bo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2011 08:51:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57486#M16033</guid>
      <dc:creator>bolore</dc:creator>
      <dc:date>2011-08-31T08:51:48Z</dc:date>
    </item>
    <item>
      <title>Create a dataset from multiple datasets/criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57487#M16034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Define efficient!&amp;nbsp; Yes, it may be using a sledge hammer to drive in a nail, but a very accurate sledge hammer. But, you are talking about less than 10 million records, which will only take up seconds of cpu time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The alternative is to develop complex macros that can easily take hours/days to write and add in numerous instances where you could error by writing something that looks like it will work but does something totally unexpected.&amp;nbsp; Since I recall you saying that you are a SAS newbee, I'd strongly recommend NOT going there too early in your learning curve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding processing, if you are not going to use all 125 variables, dropping as many as possible, as early in the process as you can, will drastically improve efficiency.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2011 12:38:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57487#M16034</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-08-31T12:38:52Z</dc:date>
    </item>
    <item>
      <title>Create a dataset from multiple datasets/criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57488#M16035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like a query problem. En... Hash Table or proc format will be a good choice.&lt;/P&gt;&lt;P&gt;Finding in a dataset once, then use Macro to run across every dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2011 03:05:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57488#M16035</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-09-01T03:05:49Z</dc:date>
    </item>
    <item>
      <title>Create a dataset from multiple datasets/criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57489#M16036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks all.&amp;nbsp; I finally managed to do this with a looped proc SQL and where statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2011 10:40:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-dataset-from-multiple-datasets-criteria/m-p/57489#M16036</guid>
      <dc:creator>bolore</dc:creator>
      <dc:date>2011-09-02T10:40:24Z</dc:date>
    </item>
  </channel>
</rss>

