The JULDATE function gets you close. Use MOD to discard the year portion.
data _null_ ;
have = '01jul2010'd ;
want = mod(juldate(have),1000) ;
put want= ;
> 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?
> Much thanks!
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.
Input 2003, output 365; Input 2004, output 366.