<?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: Day of the Year? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Day-of-the-Year/m-p/9545#M694</link>
    <description>I used a variation of this with the intnx function (which I never used before).  Works great, thanks!</description>
    <pubDate>Wed, 08 Jun 2011 19:07:00 GMT</pubDate>
    <dc:creator>zekez</dc:creator>
    <dc:date>2011-06-08T19:07:00Z</dc:date>
    <item>
      <title>Day of the Year?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Day-of-the-Year/m-p/9542#M691</link>
      <description>Hi!&lt;BR /&gt;
&lt;BR /&gt;
I am very new to SAS and am using EG.  I need a formula, or code, that will generate the day of the year (example; for 7/1/2010, the value 181 would be generated).  Any idea how to do this?&lt;BR /&gt;
&lt;BR /&gt;
Much thanks!</description>
      <pubDate>Wed, 08 Jun 2011 16:23:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Day-of-the-Year/m-p/9542#M691</guid>
      <dc:creator>zekez</dc:creator>
      <dc:date>2011-06-08T16:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Day of the Year?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Day-of-the-Year/m-p/9543#M692</link>
      <description>Here is one technique which uses INTNX function:&lt;BR /&gt;
&lt;BR /&gt;
10   data _null_;&lt;BR /&gt;
11   dt = '01jul2011'd;&lt;BR /&gt;
12   x = dt - intnx('year',dt,0);&lt;BR /&gt;
13   put x= ;&lt;BR /&gt;
14   run;&lt;BR /&gt;
&lt;BR /&gt;
x=181&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.00 seconds&lt;BR /&gt;
      cpu time            0.00 seconds&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 08 Jun 2011 16:36:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Day-of-the-Year/m-p/9543#M692</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2011-06-08T16:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: Day of the Year?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Day-of-the-Year/m-p/9544#M693</link>
      <description>The JULDATE function gets you close. Use MOD to discard the year portion.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data _null_ ;&lt;BR /&gt;
have = '01jul2010'd ;&lt;BR /&gt;
want = mod(juldate(have),1000) ;&lt;BR /&gt;
put want= ;&lt;BR /&gt;
run ;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; Hi!&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; I am very new to SAS and am using EG.  I need a&lt;BR /&gt;
&amp;gt; formula, or code, that will generate the day of the&lt;BR /&gt;
&amp;gt; year (example; for 7/1/2010, the value 181 would be&lt;BR /&gt;
&amp;gt; generated).  Any idea how to do this?&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Much thanks!</description>
      <pubDate>Wed, 08 Jun 2011 17:14:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Day-of-the-Year/m-p/9544#M693</guid>
      <dc:creator>Howles</dc:creator>
      <dc:date>2011-06-08T17:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Day of the Year?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Day-of-the-Year/m-p/9545#M694</link>
      <description>I used a variation of this with the intnx function (which I never used before).  Works great, thanks!</description>
      <pubDate>Wed, 08 Jun 2011 19:07:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Day-of-the-Year/m-p/9545#M694</guid>
      <dc:creator>zekez</dc:creator>
      <dc:date>2011-06-08T19:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: Day of the Year?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Day-of-the-Year/m-p/9546#M695</link>
      <description>Thanks all!  One follow up question, any idea how to gererate days in a given year?  EG: I want the output to be 365 for most years, and 366 for leap years.&lt;BR /&gt;
Input 2003, output 365; Input 2004, output 366.</description>
      <pubDate>Thu, 09 Jun 2011 15:13:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Day-of-the-Year/m-p/9546#M695</guid>
      <dc:creator>zekez</dc:creator>
      <dc:date>2011-06-09T15:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Day of the Year?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Day-of-the-Year/m-p/9547#M696</link>
      <description>Same type of SAS assignment statement, again using INTNX for both the start and end dates, however also there is the INTCK function too.   Have a peek at the DOC.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
intck function site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
calculate days in year site:sas.com</description>
      <pubDate>Thu, 09 Jun 2011 15:23:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Day-of-the-Year/m-p/9547#M696</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2011-06-09T15:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Day of the Year?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Day-of-the-Year/m-p/9548#M697</link>
      <description>leap years are divisible by 4 but not 100 unless divisible by 400</description>
      <pubDate>Thu, 09 Jun 2011 16:24:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Day-of-the-Year/m-p/9548#M697</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-06-09T16:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Day of the Year?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Day-of-the-Year/m-p/9549#M698</link>
      <description>[pre]&lt;BR /&gt;
&lt;BR /&gt;
%let year=2004;&lt;BR /&gt;
data _null_;&lt;BR /&gt;
 day=intck('day',"01jan&amp;amp;year"d,"01jan%eval(&amp;amp;year+1)"d);&lt;BR /&gt;
 put day=;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Fri, 10 Jun 2011 01:49:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Day-of-the-Year/m-p/9549#M698</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-06-10T01:49:38Z</dc:date>
    </item>
  </channel>
</rss>

