<?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: Creating a date spine in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Creating-a-date-spine/m-p/686114#M24383</link>
    <description>&lt;P&gt;Something like this should work for you:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;

nMonths = intck('month', start, end, 'c') + 1;

do i=1 to nMonths;
	date = intnx('month', start, i-1, 'b');
	output;
end;

format date date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;FYI - if you're checking how many people are active at each date there are other ways.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Sep 2020 16:04:07 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-09-23T16:04:07Z</dc:date>
    <item>
      <title>Creating a date spine</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-a-date-spine/m-p/686111#M24381</link>
      <description>&lt;P&gt;I am trying to join two sets of data relating to Staff Data specifically Start and End Dates and Total Available Positions with in the Department.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need a graph to show the number of employees vs. number of headcount for the department in a stacked bar graph.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As a first step -&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking to create a “date spine” for the relevant time period that simply has one record for each date in the period.&amp;nbsp; &amp;nbsp;keeping only the dates that represent the first of the month (I don’t need to chart this stuff for each day, so this will reduce the amount of data I have).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Staff data file has all information including start and end date for each employee over the last 10 years.&lt;/P&gt;&lt;P&gt;The total available positions file has a start and end date for each time there was an increase or decrease in headcount given to the department by the company.&lt;/P&gt;&lt;P&gt;Ex.&amp;nbsp;Start Date&amp;nbsp; &amp;nbsp; &amp;nbsp; End Date&amp;nbsp; &amp;nbsp; &amp;nbsp;Total FTE allotted&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 01May2014&amp;nbsp; &amp;nbsp;31Mar2015&amp;nbsp; &amp;nbsp;20&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 01Apr2015&amp;nbsp; &amp;nbsp; 09Dec2018&amp;nbsp; &amp;nbsp;22&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Knowing this information I would want a numeric value of employees that worked in this data range to populate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my first SAS project in 8 months and I am struggling to format my data in a way that returns to me this information. Any pointers appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 15:55:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-a-date-spine/m-p/686111#M24381</guid>
      <dc:creator>abar228</dc:creator>
      <dc:date>2020-09-23T15:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a date spine</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-a-date-spine/m-p/686114#M24383</link>
      <description>&lt;P&gt;Something like this should work for you:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;

nMonths = intck('month', start, end, 'c') + 1;

do i=1 to nMonths;
	date = intnx('month', start, i-1, 'b');
	output;
end;

format date date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;FYI - if you're checking how many people are active at each date there are other ways.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 16:04:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-a-date-spine/m-p/686114#M24383</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-09-23T16:04:07Z</dc:date>
    </item>
  </channel>
</rss>

