BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Sandeep77
Lapis Lazuli | Level 10

Hi all,

I have a data set which had date format 01/12/2000:00:00:00. I want to change it to 01/12/2000 format. I used the datepart function but the date I am getting is now in 01DEC2000 format. Can you suggest how to get the output in 01/12/2000 format?

Proc sql;
create table Linked_for_CF as 
select debt_code as accountnumber, 
 AddressLine1, 
AddressLine2, 
AddressLine3, 
AddressLine4, 
Postcode, 
Title, 
Forename, 
Surname,
Datepart (Dr_DOB) format date9. as Dateofbirth 
from Linked_acc;
quit;
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

After you use the datepart function, assign format mmddyys10.

--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

After you use the datepart function, assign format mmddyys10.

--
Paige Miller
Sandeep77
Lapis Lazuli | Level 10
Thank you. It worked. I actually wanted it in ddmmyys10. format. Thanks again.
PaigeMiller
Diamond | Level 26

Adding ... don't assign it format DATE9. if you want some other format.

--
Paige Miller

SAS Innovate 2025: Call for Content

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!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 532 views
  • 1 like
  • 2 in conversation