BookmarkSubscribeRSS Feed
Smitha9
Fluorite | Level 6

Hi,

I need a dataset from 

07/29/2022 to 08/31/2022 in SAS.

 

thanks in advance.

 

 

4 REPLIES 4
PaigeMiller
Diamond | Level 26

Can you provide more details?

--
Paige Miller
Smitha9
Fluorite | Level 6
dataset
ID Date
1 01/22/2021
2 02/23/2022
3 07/29/2022
4 08/01/2022
5 08/15/2022

I want to dataset from 07/20/2022 to 08/31/2022
ID Date
1 07/29/2022
2 08/01/2022
3 08/15/2022
PaigeMiller
Diamond | Level 26

Assuming these are numeric date variables 

 

data want;
    set have;
    if '20JUL2022'd <= date <= '31AUG2022'd;
run;

 

Please provide data as working SAS data step code from now on. You can follow these instructions or type the working SAS data step code yourself. Doing this avoids us having to make assumptions or guesses about your data (which might be incorrect), which makes it much more likely that people can provide correct answers; this helps you and helps us.

--
Paige Miller
Kurt_Bremser
Super User

@Smitha9 wrote:

Hi,

I need a dataset from 

07/29/2022 to 08/31/2022 in SAS.


The answer to this question is

data want;
do date = '29jul2022'd to '31aug2022'd;
  output;
end;
format date mmddyy10.;
run;

But we may have a Maxim 42 issue here.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 688 views
  • 0 likes
  • 3 in conversation