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?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.