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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

From SAS Users blog
Want more? Visit our blog for more articles like these.
5 Steps to Your First Analytics Project Using SAS

For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.

Find more tutorials on the SAS Users YouTube channel.

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