BookmarkSubscribeRSS Feed
Pooja98
Fluorite | Level 6

Hi all,

 

i got some data on daily basis, but i want to convert it into weekly basis

i need it like on Saturday -Friday basis

For example,

 

1. 09-06-21

2. 14-06-21

3. 05-06-21

4. 11-06-21

5. 28-06-21

6. 25-06-21

7. 04-06-21

 

where No.7 lies in one week, whereas No.1,3,4 lies in another week.

my data contains record from 2019, but i need it on weekly basis.

It will be helpful if its available in both SAS and excel solution.

 

Thanks In Advance

3 REPLIES 3
ballardw
Super User

I am not sure what your desired output would look like. You need to provide an example of the expected output.

 

First question, are your "dates" actually SAS date values? Show us the variable type and format from Proc Contents for your variable.

Ksharp
Super User
Check function WEEK() .
Kurt_Bremser
Super User

SAS procedures (except SQL) that do summarizing will honor formatted values of class/group variables, so there you only need to use a week-based format.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

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
  • 3 replies
  • 684 views
  • 0 likes
  • 4 in conversation