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



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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