![]() | ![]() | ![]() | ![]() | ![]() |
http://aa.usno.navy.mil/faq/docs/easter.html
Sample provided as is, no warranties expressed or implied.
For other US holidays, see Using SAS to determine dates for holidays.
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
/***************************************************************************************/
/* This sample code is based upon an algorithm described on the U.S. Naval Observatory */
/* Website: http://aa.usno.navy.mil/faq/docs/easter.html */
/* */
/* This sample provided 'as is', no warranties expressed or implied. */
/***************************************************************************************/
data a (keep=easter_date);
format easter_date worddate.;
do year=1980 to 2024;
c=int(year/100);
n=year-(19*int(year/19));
k=int((c-17)/25);
i=c-int(c/4)-int((c-k)/3)+(19*n)+15;
i=i-(30*int(i/30));
i=i-(int(i/28)*(1-int(i/28)*int(29/(i+1))*int((21-n)/11)));
j=year+int(year/4)+i+2-c+int(c/4);
j=j-(7*int(j/7));
month=3+int((i-j+40)/44);
day=i-j+28-(31*int(month/4));
easter_date=mdy(month,day,year);
output;
end;
run;
proc print;
run;
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
Obs easter_date 1 April 6, 1980 2 April 19, 1981 3 April 11, 1982 4 April 3, 1983 5 April 22, 1984 6 April 7, 1985 7 March 30, 1986 8 April 19, 1987 9 April 3, 1988 10 March 26, 1989 11 April 15, 1990 12 March 31, 1991 13 April 19, 1992 14 April 11, 1993 15 April 3, 1994 16 April 16, 1995 17 April 7, 1996 18 March 30, 1997 19 April 12, 1998 20 April 4, 1999 21 April 23, 2000 22 April 15, 2001 23 March 31, 2002 24 April 20, 2003 25 April 11, 2004 26 March 27, 2005 27 April 16, 2006 28 April 8, 2007 29 March 23, 2008 30 April 12, 2009 31 April 4, 2010 32 April 24, 2011 33 April 8, 2012 34 March 31, 2013 35 April 20, 2014 36 April 5, 2015 37 March 27, 2016 38 April 16, 2017 39 April 1, 2018 40 April 21, 2019 41 April 12, 2020 42 April 4, 2021 43 April 17, 2022 44 April 9, 2023 45 March 31, 2024
http://aa.usno.navy.mil/faq/docs/easter.html
| Type: | Sample |
| Topic: | SAS Reference ==> DATA Step Data Management ==> Manipulation and Transformation ==> Date and Time SAS Reference ==> Functions ==> Date and Time ==> MDY |
| Date Modified: | 2008-04-16 15:41:28 |
| Date Created: | 2005-12-15 17:03:08 |
| Product Family | Product | Host | Starting Release | Ending Release |
| SAS System | Base SAS | All | n/a | n/a |





