Data I have:
10/22/2005
01/10/2010
Data I want:
October 22, 2005
January 10, 2010
If possible, I would the day of the week for each date. Example: 04/04/2019 becomes Thursday, April 4, 2019
Hi @VDD Good answer, but may i ask why are you using anydt informat as opposed to mmddyy informat. No biggie but just wondering
I used that format in the second date step just because it was usable there. I could have used the mmddyy10. format.
here is a sample where you could have the full request in 1 variable.
data want;
set have;
new_date=input(date,anydtdte21.);
weekday=input(date,anydtdte21.);
one_date = input(date,anydtdte21.);
format weekday DOWNAME. new_date worddate. one_date weekdate.;
run;
Try this,
you'll get weekday and date in same column
data want;
set have;
format date WEEKDATX23.;
run;
@Shivam did your run the code or just read the code?
Hi,
I ran your code, that worked fine. why?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.