This scenario uses the
Certadv.Staff data set. Write a SAS program that does the following:
-
Define a macro variable named Job
with a value of Analyst.
-
Use a DATA step to create a temporary
data set Work.Staff from the data set Certadv.Staff. Within this DATA
step, do the following:
-
Read in only those rows from the
Certadv.Staff data set that contain the text specified in the macro
variable Job.
-
Create a new column that keeps
a running total of Salary. Code:Total+Salary;
-
Create a Count variable and increment
its value by one for each observation. Code: Count+1;
-
Create a new macro variable named
Avg. The value of Avg is the value of Total divided by the value of
Count. Format Avg as DOLLAR9.