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).

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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