<?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: Working With Dates in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Working-With-Dates/m-p/475285#M71143</link>
    <description>&lt;P&gt;So if T-1 is a holiday, you still want T-2 to T+2?&amp;nbsp; Not T-3 to T+2?&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jul 2018 18:12:01 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-07-03T18:12:01Z</dc:date>
    <item>
      <title>Working With Dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Working-With-Dates/m-p/475248#M71135</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question on restricting dates.&amp;nbsp; I have columns like so -- "Date", "Price", "Tflag".&amp;nbsp; Wherever the "Tflag" column = '***', I would like to take the range of T+2 and T-2 for date.&amp;nbsp; &amp;nbsp;What i did originally was create lags(one ascending, one descending) of Date and created two new variables Date1 and Date2.&amp;nbsp; This created the correct range on each tflag = ***.&amp;nbsp; But i cannot figure out how to restrict my Date column by this range I created.&amp;nbsp; Also, it is important to note that we are dealing with Trading Days and not just standard days. I say this because if a Tflag&amp;nbsp; is on 6/25/2018 then the t-2 day would be 6/21/2018 and t+2 would be 6/27/2018.&amp;nbsp; This would encompass a total of five dates, which it always should be unless there is significant days in a row.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 16:31:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Working-With-Dates/m-p/475248#M71135</guid>
      <dc:creator>jrdykstr93</dc:creator>
      <dc:date>2018-07-03T16:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Working With Dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Working-With-Dates/m-p/475250#M71136</link>
      <description>&lt;P&gt;Have you looked at INTNX with the WEEKDAY option? Though you may want to create your own calendar to account for the unique calendar.&lt;/P&gt;
&lt;P&gt;Otherwise, a SQL self join usually works, and/or using PROC EXPAND to calculate a moving&amp;nbsp;statistics with the CONVERT statement.&amp;nbsp;&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/199376"&gt;@jrdykstr93&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a question on restricting dates.&amp;nbsp; I have columns like so -- "Date", "Price", "Tflag".&amp;nbsp; Wherever the "Tflag" column = '***', I would like to take the range of T+2 and T-2 for date.&amp;nbsp; &amp;nbsp;What i did originally was create lags(one ascending, one descending) of Date and created two new variables Date1 and Date2.&amp;nbsp; This created the correct range on each tflag = ***.&amp;nbsp; But i cannot figure out how to restrict my Date column by this range I created.&amp;nbsp; Also, it is important to note that we are dealing with Trading Days and not just standard days. I say this because if a Tflag&amp;nbsp; is on 6/25/2018 then the t-2 day would be 6/21/2018 and t+2 would be 6/27/2018.&amp;nbsp; This would encompass a total of five dates, which it always should be unless there is significant days in a row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 16:33:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Working-With-Dates/m-p/475250#M71136</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-03T16:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Working With Dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Working-With-Dates/m-p/475259#M71137</link>
      <description>&lt;P&gt;You have omitted critical information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do you want to account for holidays?&amp;nbsp; SAS can detect weekdays, but you need to somehow supply the holiday information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the order to the observations?&amp;nbsp; Do the observations you want to select fall both before and after the observation where tflag is *** ?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 16:54:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Working-With-Dates/m-p/475259#M71137</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-07-03T16:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Working With Dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Working-With-Dates/m-p/475275#M71139</link>
      <description>&lt;P&gt;Its only trading days.&amp;nbsp; So holidays are excluded.&amp;nbsp; The subset of observations I would like to select fall T-2 and T+2 based on what date there is a tflag = '***'.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 17:31:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Working-With-Dates/m-p/475275#M71139</guid>
      <dc:creator>jrdykstr93</dc:creator>
      <dc:date>2018-07-03T17:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Working With Dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Working-With-Dates/m-p/475276#M71140</link>
      <description>&lt;P&gt;My SQL knowledge is embarrassing.&amp;nbsp; But I will look into proc expand. Thanks.l&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 17:34:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Working-With-Dates/m-p/475276#M71140</guid>
      <dc:creator>jrdykstr93</dc:creator>
      <dc:date>2018-07-03T17:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Working With Dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Working-With-Dates/m-p/475285#M71143</link>
      <description>&lt;P&gt;So if T-1 is a holiday, you still want T-2 to T+2?&amp;nbsp; Not T-3 to T+2?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 18:12:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Working-With-Dates/m-p/475285#M71143</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-07-03T18:12:01Z</dc:date>
    </item>
  </channel>
</rss>

