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?
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.