<?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: Fortnight Data. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Fortnight-Data/m-p/517720#M140036</link>
    <description>&lt;P&gt;In my case I have to get the report only for few restricted dates i.e 15,28,29,30 and 31 for all the years and months. If I use VA to generate the report I can select only these dates.&lt;/P&gt;</description>
    <pubDate>Sat, 01 Dec 2018 05:06:19 GMT</pubDate>
    <dc:creator>Swati24</dc:creator>
    <dc:date>2018-12-01T05:06:19Z</dc:date>
    <item>
      <title>Fortnight Data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fortnight-Data/m-p/517009#M139690</link>
      <description>&lt;P&gt;I have a data set for which I have to create fortnight. The report should have 3 columns for example if the date given is 15 Nov,2018 then it should give me the values for col1 from 1 to 15 of Nov,2018, for col2 16 to 31 of Oct,2018 and col3 from 1 to 15 of Nov,2017 for the count of Action.&lt;/P&gt;&lt;P&gt;data set is like this&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
input UID Action: $10. Date: Date9.;
datalines;
101 Pending 05Jan2011
102 Executed 09Jan2011
103 Failed 15Feb2011
104 Warning 29Feb2012
105 Executed 1Mar2012
106 Executed 17Mar2013
107 Pending 30Apr2013
108 Failed 18Sep2014
109 Failed 26Nov2014
110 Warning 15Aug2015
111 Pending 31Dec2018
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Nov 2018 12:14:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fortnight-Data/m-p/517009#M139690</guid>
      <dc:creator>Swati24</dc:creator>
      <dc:date>2018-11-29T12:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Fortnight Data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fortnight-Data/m-p/517027#M139702</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
input UID Action: $10. Date: Date9.;
format date date9.;
datalines;
101 Pending 05Jan2011
102 Executed 09Jan2011
103 Failed 15Feb2011
104 Warning 29Feb2012
105 Executed 1Mar2012
106 Executed 17Mar2013
107 Pending 30Apr2013
108 Failed 18Sep2014
109 Failed 26Nov2014
110 Warning 15Aug2015
111 Pending 31Dec2018
;
run;
proc sql;
create table want as
select *,
(select count(distinct Action) from one where date between intnx('month',a.date,0) and a.date) as col1,
(select count(distinct Action) from one where date between intnx('month',a.date,-1,'m') 
and intnx('month',a.date,-1,'e')) as col2,
(select count(distinct Action) from one where date between intnx('month',intnx('year',a.date,-1,'s'),0)
and intnx('year',a.date,-1,'s')) as col3
 
 from one as a;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Nov 2018 13:18:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fortnight-Data/m-p/517027#M139702</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-11-29T13:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Fortnight Data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fortnight-Data/m-p/517137#M139738</link>
      <description>&lt;P&gt;Perhaps add a variable representing the first day of the fortnight?&lt;/P&gt;
&lt;PRE&gt;data one;
input UID Action: $10. Date: Date9.;
fortnight = intnx('semimonth',date,0,'b');
format date fortnight date9.;
datalines;
101 Pending 05Jan2011
102 Executed 09Jan2011
103 Failed 15Feb2011
104 Warning 29Feb2012
105 Executed 1Mar2012
106 Executed 17Mar2013
107 Pending 30Apr2013
108 Failed 18Sep2014
109 Failed 26Nov2014
110 Warning 15Aug2015
111 Pending 31Dec2018
;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Nov 2018 16:44:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fortnight-Data/m-p/517137#M139738</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-11-29T16:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Fortnight Data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fortnight-Data/m-p/517720#M140036</link>
      <description>&lt;P&gt;In my case I have to get the report only for few restricted dates i.e 15,28,29,30 and 31 for all the years and months. If I use VA to generate the report I can select only these dates.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Dec 2018 05:06:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fortnight-Data/m-p/517720#M140036</guid>
      <dc:creator>Swati24</dc:creator>
      <dc:date>2018-12-01T05:06:19Z</dc:date>
    </item>
  </channel>
</rss>

