BookmarkSubscribeRSS Feed
Smitha9
Fluorite | Level 6

I have a dataset with

20170306

20180306

I want to change to 

2017-03-06

2018-03-06

with dashes.

 

 

2 REPLIES 2
Reeza
Super User
What is the variable type? If it's numeric with a date format, such as YYMMDDN8. you can switch it to YYMMDDD8. instead.

format variableName YYMMDDD8.;
Astounding
PROC Star

Right idea, but switch instead to the YYMMDDD10. format to allow for a four-digit year.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

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
  • 2 replies
  • 743 views
  • 4 likes
  • 3 in conversation