Hi Guys,
Can you please help me to write a code for weekly report using weekday function and to automatically run on every monday morning.
I got daily data like below for 6 months..
calendar_date | _FREQ_ | Balance |
10Jan2019 | 5180 | 1480096401.80 |
11Jan2019 | 5185 | 1479431521.37 |
12Jan2019 | 5185 | 1479431521.37 |
13Jan2019 | 5185 | 1479431521.37 |
14Jan2019 | 5183 | 1479938213.77 |
15Jan2019 | 5192 | 1481255273.06 |
16Jan2019 | 5198 | 1486672020.87 |
17Jan2019 | 5199 | 1481255277.06 |
18Jan2019 | 6000 | 1486672080.87 |
Logic for: -
- the report should run every monday to pick friday data only (like 18th jan 2019)..
- the report should compare last two fridays numbers (like 11th jan 2019 and 18th jan 2019)
appreciate if you can send me the sample codes using weekdays for weekly report using daily data tables..
thanks you
You don't really say what you want.
This answers the expressed need:
data WANT;
set HAVE;
where put(CALENDAR_DATE,downame. -l)='Friday';
DELTA=(BALANCE-lag(BALANCE))/lag(BALANCE);
format DELTA percent8.2;
run;
CALENDAR_DATE | BALANCE | DELTA |
---|---|---|
11JAN2019 | 1479431521.4 | . |
18JAN2019 | 1486672080.9 | 0.49% |
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!
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.