Introduction to SAS Coding Project (solution) - Store KPI Analysis

Coding Project (Answer)

[Note: you are recommended to copy and paste the code below onto your SAS Studio for better viewing]

Model Answer

** Create a permanent library **;
** IMPORTANT: update the path with your unique user name **;
Libname CPROJ1 '/home/your_user_name';

** Run the commented code below if you are using SAS University Edition **;
*Libname CPROJ1 '/folders/myfolders';

** Use INPUT and DATALINES statement to read in the data **;
Data KPI;
Input Store $ Revenue Staff Salary Operation Profit Complaint Turnover;
Datalines;
STORE101 128000 18 29200 15200 83600 5 2
STORE102 158000 17 19000 12000 127000 11 2
STORE103 138000 18 26300 10500 101200 7 1
STORE104 101000 17 19700 19700 61600 5 2
STORE105 123000 15 29500 10400 83100 7 1
STORE106 189000 13 24400 12600 152000 5 2
STORE107 135000 10 24800 11900 98300 5 2
STORE108 130000 14 19400 11000 99600 3 1
STORE109 191000 12 28300 10500 152200 8 2
STORE110 176000 10 23500 15900 136600 9 1
;
Run;

** Create a subset data set from KPI and save it in the CPROJ1 library **;
Data CPROJ1.KPI2;
Set KPI;
If Revenue/Staff > 10000;
Run;