WINTER 2011
TECHIE TIPS
User Profile: Jared Prins
Read.
Education User Tip: James Profitt
Read.
Have you changed companies? Do you want to modify your contact preferences? Don’t forget to update your SAS profile!
For details on all of SAS' products and solutions, click here.
The SAScom blog: http://blogs.sas.com/sascom/
SAS Canada
Name: James Profitt
Techie Tip: SAS Code for Working out Easter

%let process_date=%sysfunc(date());

data easter(keep=bill_date year is_bank_holiday);
do iter = 0 to 3;
year = year(intnx("year",&process_date,iter));
a = mod(year,19);
b = int(year/100);
c = mod(year,100);
d = int(b/4);
e = mod(b,4);
f = int((b + 8) / 25);
g = int((b - f + 1) / 3);
h = mod(19*a + b - d - g + 15,30);
i = int(c/4);
k = mod(c,4);
L = mod((32 + 2*e + 2*i - h - k),7);
m = int((a + 11*h + 22*L) / 451);
easter_month = int((h + L - 7*m + 114) / 31);
easter_day = mod((h + L - 7*m + 114),31) + 1;
base_date = input(compress(put(easter_day,z2.) || put(easter_month,z2.) || put(year,4.)),ddmmyy8.);
bill_date = base_date;
is_bank_holiday = 1;
bill_date = base_date + 1; /* easter monday */
output;
bill_date = base_date - 2; /* good friday */
format bill_date date9.;
output;
end;
run;

SAS and all other SAS Institute Inc. product or service names are registered trademarks \or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. Other brand and product names are trademarks of their respective companies. Copyright © 2009, SAS Institute Inc. All rights reserved.
P