Hi,
I have a report that I need to create each month.
The problem I'm facing when I'm trying to program it, I'm finding difficulties bc for the following reason.
this is a sample of the dataset and the program;
TaskStatus | CompleteDate |
Assigned | |
Assigned | |
Assigned | |
Assigned | |
Assigned |
data Asterias2;
set Asterias1;
if taskstatus="Assigned" and completedate=" " then count=1;
run;
%let thismonthn=%sysfunc(today(),MONNAME.) ;
%put &thismonthn;
proc sql;
create table Asterias3 as
select
sum(count) as &thismonthn
from asterias2;
quit;
the problem I'm having that I'm having I need to create the variable &thismonthn and I also want to be able to store the outcomes
and the next month when I run the program again I will have &thismonmthn and prior month
The easiest way to store data is in a permanent SAS data set, then it can be used in future runs of the program.
But this part isn't really clear
the problem I'm having that I'm having I need to create the variable &thismonthn and I also want to be able to store the outcomes
and the next month when I run the program again I will have &thismonmthn and prior month
Do you mean you want the count and the month to be stored, and the values from previous months also stored in the same place?? If so, you could certainly use PROC APPEND to add the current months results to the results of previous months.
The easiest way to store data is in a permanent SAS data set, then it can be used in future runs of the program.
But this part isn't really clear
the problem I'm having that I'm having I need to create the variable &thismonthn and I also want to be able to store the outcomes
and the next month when I run the program again I will have &thismonmthn and prior month
Do you mean you want the count and the month to be stored, and the values from previous months also stored in the same place?? If so, you could certainly use PROC APPEND to add the current months results to the results of previous months.
Here's what you get with PROC APPEND, does this meet your needs?
MONTH COUNT 012018 38 022018 57 032018 45 ...
Show us an example of what you want, for say three or four months of results.
I got the idea.
Thanks
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.