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-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

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