SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
JulieB
Fluorite | Level 6

I have a dataset with dates in E8601DA10. format.  I looked this up and it seems it's an ISO date.  I have not worked with this format before.  I have a lot of data and need to search for rows with dates occurring in 2020 or 2021.  Can anyone tell me how to search for dates in this range using the format I have, or help me convert to the more conventional date. format which I am more comfortable working with?

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

A format only affects the way a value is displayed. The value remains the same.

If your value is a SAS date, you can use it as you are used to, regardless of the format applied. In your case, it looks like you should use the year() function.

View solution in original post

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

A format only affects the way a value is displayed. The value remains the same.

If your value is a SAS date, you can use it as you are used to, regardless of the format applied. In your case, it looks like you should use the year() function.

JulieB
Fluorite | Level 6

Thanks - very helpful!

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2 replies
  • 1304 views
  • 0 likes
  • 2 in conversation