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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1235 views
  • 4 likes
  • 3 in conversation