I use SAS 9.1. I want to get the order week of the month. such as 1st , 2nd , 3rd week of the month. Could anyone can help me ?
For example:
Date | Month | need : WeeK_num_ of Month |
15-Mar | Mar | 3 |
16-Mar | Apr | 3 |
17-Mar | May | 4 |
18-Mar | Jun | 4 |
19-Mar | Jul | 4 |
20-Mar | Aug | 4 |
21-Mar | Sep | 4 |
22-Mar | Oct | 4 |
23-Mar | Nov | 4 |
24-Mar | Dec | 5 |
25-Mar | Jan | 5 |
26-Mar | Feb | 5 |
27-Mar | Mar | 5 |
28-Mar | Apr | 5 |
29-Mar | May | 5 |
30-Mar | Jun | 5 |
31-Mar | Jul | 6 |
1-Apr | Apr | 1 |
2-Apr | May | 1 |
3-Apr | Jun | 2 |
4-Apr | Jul | 2 |
5-Apr | Aug | 2 |
6-Apr | Sep | 2 |
7-Apr | Oct | 2 |
8-Apr | Nov | 2 |
9-Apr | Dec | 2 |
10-Apr | Jan | 3 |
11-Apr | Feb | 3 |
12-Apr | Mar | 3 |
13-Apr | Apr | 3 |
Thanks in advance.
The SAS website has a solution for this.
The SAS website has a solution for this.
I tried it from the link and worked it out. Thank you very much , Keith.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.