<?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: Split DataSets In Years Based On Date Variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129498#M260511</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanx for your interest in the topic Reeza.&lt;/P&gt;&lt;P&gt;Currently the dataset as a whole reflects the date field (i.e. labeled as MIS_Month) as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01JAN2007&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01FEB2007&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01AUG2013&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firstly I wanted to break the data based on Date basis as a whole because of only single first day of every month. But now, I think it would be better to consider the same variable for breaking the dataset on &lt;STRONG&gt;yearly basis&lt;/STRONG&gt; instead of date as a whole.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Sep 2013 04:05:44 GMT</pubDate>
    <dc:creator>FarazA_Qureshi</dc:creator>
    <dc:date>2013-09-05T04:05:44Z</dc:date>
    <item>
      <title>Split DataSets In Years Based On Date Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129495#M260508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Being a newbie in SAS sure do need your help because of the system reporting:&lt;/P&gt;&lt;P&gt;ERROR: Hash object added 65520 items when memory failure occurred.&lt;/P&gt;&lt;P&gt;FATAL: Insufficient memory to execute data step program. Aborted during the EXECUTION phase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Most probably because of extended DataSet with numerous fields. I was using the following code:&amp;nbsp; to group datasets in different monthly files.&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;if 0 then set Temp2.Allprod2;&lt;/P&gt;&lt;P&gt;dcl hash groups ( ordered: 'a');&lt;/P&gt;&lt;P&gt;groups.definekey ('MIS_Month','_n_');&lt;/P&gt;&lt;P&gt;groups.definedata ('MIS_Month', 'MOB', 'Customer_No', 'Customer_Name', 'CNIC', 'Loan_Number', 'Disbursment_Date', 'Vintage_Date', 'Rehab_Date', 'Product_Desc', 'Product', 'Loan_Type', 'Rehab_Desc', 'Rehab_Cat', 'Bucket', 'Dpd', 'POS', 'Loan_Status', 'WriteOff_Date', 'Provision_Status', 'Provision_Charge', 'Provision_Balance', 'Loan_Amount', 'Subsegmentall', 'Account_Tagging' );&lt;/P&gt;&lt;P&gt;groups.definedone ();&lt;/P&gt;&lt;P&gt;do _n_ = 1 by 1 until (last.MIS_Month);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set Temp2.Allprod2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by MIS_Month;&lt;/P&gt;&lt;P&gt;&amp;nbsp; groups.add();&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;groups.output (dataset: compress('Temp2.Data_'||YEAR(MIS_Month)||'_'||MONTH(MIS_Month)));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any recommendation how to use the MIS_Month, currently representing last day of each month, but this time breaking data on &lt;STRONG&gt;yearly basis&lt;/STRONG&gt; so as to later on carryout &lt;STRONG&gt;month wise&lt;/STRONG&gt; breakup to avoid halt of procedure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Sep 2013 20:52:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129495#M260508</guid>
      <dc:creator>FarazA_Qureshi</dc:creator>
      <dc:date>2013-09-04T20:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: Split DataSets In Years Based On Date Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129496#M260509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like your need to upgrade your RAM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Sep 2013 21:13:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129496#M260509</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-09-04T21:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Split DataSets In Years Based On Date Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129497#M260510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or use a macro and SQL/Data step approach instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://www.sascommunity.org/wiki/Split_Data_into_Subsets" title="http://www.sascommunity.org/wiki/Split_Data_into_Subsets"&gt;http://www.sascommunity.org/wiki/Split_Data_into_Subsets&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: What does your date field look like, formatted as? Also, are you trying to resolve the hash error or change the code to split the file?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Sep 2013 21:31:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129497#M260510</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-09-04T21:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Split DataSets In Years Based On Date Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129498#M260511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanx for your interest in the topic Reeza.&lt;/P&gt;&lt;P&gt;Currently the dataset as a whole reflects the date field (i.e. labeled as MIS_Month) as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01JAN2007&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01FEB2007&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01AUG2013&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firstly I wanted to break the data based on Date basis as a whole because of only single first day of every month. But now, I think it would be better to consider the same variable for breaking the dataset on &lt;STRONG&gt;yearly basis&lt;/STRONG&gt; instead of date as a whole.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Sep 2013 04:05:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129498#M260511</guid>
      <dc:creator>FarazA_Qureshi</dc:creator>
      <dc:date>2013-09-05T04:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Split DataSets In Years Based On Date Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129499#M260512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could create a year variable using the year() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Sep 2013 05:53:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129499#M260512</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2013-09-05T05:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Split DataSets In Years Based On Date Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129500#M260513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why do you need/want to split the data set? Did you consider creating an index instead?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Sep 2013 21:54:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129500#M260513</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2013-09-05T21:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Split DataSets In Years Based On Date Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129501#M260514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for a late reply Richard.&lt;/P&gt;&lt;P&gt;However Couldn't&amp;nbsp; I use any other way to determine the year from the date variable without adding an additional field/function of yr?&lt;/P&gt;&lt;P&gt;Had to use the SQL procedure of creating datasets but for different years&lt;/P&gt;&lt;P&gt;Any idea how to achieve the same with a looping code instead of running similar SQL codes multiple times, for different years? &lt;/P&gt;&lt;P&gt;Thanx again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 18:36:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129501#M260514</guid>
      <dc:creator>FarazA_Qureshi</dc:creator>
      <dc:date>2013-09-06T18:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Split DataSets In Years Based On Date Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129502#M260515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanx for your suggestion Patrick&lt;/P&gt;&lt;P&gt;Please see if u can guide me in understanding the role of index and way to use the same in this condition. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 18:42:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129502#M260515</guid>
      <dc:creator>FarazA_Qureshi</dc:creator>
      <dc:date>2013-09-06T18:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Split DataSets In Years Based On Date Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129503#M260516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;WHY do you want to split the dataset into pieces?&lt;/P&gt;&lt;P&gt;Is it for some reporting purpose?&amp;nbsp; Some analysis?&lt;/P&gt;&lt;P&gt;You do not need to use HASH to do this.&lt;/P&gt;&lt;P&gt;If you know the range of years then just write the code to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data y2011 y2012 y2013 other;&lt;/P&gt;&lt;P&gt; set Temp2.Allprod2;&lt;/P&gt;&lt;P&gt; select (year(mis_month)) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; when (2011) output y2011;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; when (2012) output y2012;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; when (2013) output y2013;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; otherwise output other;&lt;/P&gt;&lt;P&gt; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need you can add some more code to query the data to determine the number actual values of year so that it can generate the code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 18:50:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129503#M260516</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-09-06T18:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Split DataSets In Years Based On Date Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129504#M260517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please tell us WHY you want to split the data set? What do you want to achieve with this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are often better ways than physically splitting data set and replicating data. So in giving us your reasons we might come up with appropriate suggestions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 23:21:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Split-DataSets-In-Years-Based-On-Date-Variables/m-p/129504#M260517</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2013-09-06T23:21:35Z</dc:date>
    </item>
  </channel>
</rss>

