BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Jyuen204
Obsidian | Level 7

Looked up in SAS for dates. I Want it in a YYMMDD fields and the closes i found was the format below. However it generates the dat with dashes
where I would want it like 120317

 

YYMMDD.
19069
12-03-17
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Try format YYMMDDN6.

 

Do a smart thing and use four digit years, which would be YYMMDDN8.

--
Paige Miller

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

Try format YYMMDDN6.

 

Do a smart thing and use four digit years, which would be YYMMDDN8.

--
Paige Miller
Jyuen204
Obsidian | Level 7
Thank You! I would normally do the full on year. I am just migrating a legacy solution over to SAS so changing the format is not required.
Ksharp
Super User
Pick the right format:

data _null_;
date=date();
put date yymmddn6.;
run;
Reeza
Super User
Format right after that one in the documentation.
Very good page to bookmark
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/n0p2fmevfgj470n17h4k9f27qjag.ht...
ballardw
Super User

You need to very carefully label things in examples. You may not be aware but in one form 19069 could be 10 March 2019 (Julian date notation; or could be 1919, 1819,2119 for the year, 2 digit years are such a pain to keep straight).

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

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1458 views
  • 4 likes
  • 5 in conversation