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.

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!

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.

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