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

Hi 🙂

 

What is the best way to print a date that holds no data in a large dataset for a specific date range? For example, I halve multiple records in one dataset for the last 7 days. In the dataset one of the dates in the last 7 days contains no data. How would I write code for SAS to highlight which date holds no data?

In the below, I would want SAS to highlight 01/31/2020 as this is the date that is missing from the last 7 days. 

data have;

     input date:mmddyy10.  car_key;

     format date mmddyy10.;

     cards;

01/28/20 20071031
01/29/20 20070930
01/30/20 20070831
02/01/20 20070831
02/02/20 20070630
02/03/20 20070531

;RUN;

 

1 ACCEPTED SOLUTION

Accepted Solutions
tomrvincent
Rhodochrosite | Level 12
I created a hundred-year calendar dataset which I can then right-join to a dataset like your 'have' to easily select missing dates.

View solution in original post

1 REPLY 1
tomrvincent
Rhodochrosite | Level 12
I created a hundred-year calendar dataset which I can then right-join to a dataset like your 'have' to easily select missing dates.

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

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
  • 1 reply
  • 645 views
  • 0 likes
  • 2 in conversation