I wanted to double check that 1= Sunday, 2= Monday, etc. because I was able to label the days of the week for the patients' last appointment (i.e. Jane Smith was day 3, Laura Smellner was day 5), but when I used the format weekdate9. to get the actual day it made 3= Monday, 5= Wednesday, etc.
DATA scheduling(drop=bdate);
input patient $ 1-17 bdate :mmddyy10. lastappt :mmddyy10.;
Day=weekday(lastappt);
format bdate lastappt mmddyy10. day weekdate9.;
DATALINES;
Jane Smith 10/25/1985 06/15/2010
Laura Smellner 10/20/1947 06/17/2010
Jenna Jones 10/23/1964 07/01/2010
Beth Bonders 10/26/1939 07/14/2010
Grace Johson 10/19/1958 07/29/2010
Mary Contrary 10/22/1981 06/30/2010
Jennifer Palermo 10/21/1953 09/03/2010
Ann Lewis 10/24/1975 08/15/2010
Linda Bentner 10/13/1938 09/04/2010
Francine Scalia 10/14/1963 09/04/2010
Leah Thill 10/15/1949 08/01/2010
Caroline Harris 10/16/1968 08/11/2010
Olivia Knupf 10/17/1972 07/31/2010
Maya Angelson 10/18/1961 07/17/2010
;
RUN;
Hi,
You use weekday function and it's returns integer that represents day like 1=Sunday 2=Monday etc.
Then you format with this day varible with weekdate9.
Thats meaning you getting which day of 4 June 1960 when day=3
I suggest you directly convert lastappt variable,
Day=put(lastappt,weekdate9.)
Hi,
You use weekday function and it's returns integer that represents day like 1=Sunday 2=Monday etc.
Then you format with this day varible with weekdate9.
Thats meaning you getting which day of 4 June 1960 when day=3
I suggest you directly convert lastappt variable,
Day=put(lastappt,weekdate9.)
Thank you!
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.