Monday, April 4, 2011

SAS Assignment 1

Question 1
● Use the Base SAS windowing environment to write and submit a simple SAS program
● Given the data set:

Salesperson ,
Target company,
Number of visits,
Number of phone calls,
Units sold,

Brown American 3 12 28000
Johnson VRW 6 14 33000
Rivera Texam 2 6 8000
Brown Standard 0 22 0
Brown Knowles 2 19 12000
Rivera Metro 4 8 13000
Rivera Uniman 8 7 27000
Johnson Oldham 3 16 8000
Johnson Rondo 2 14 2000

1. Write a SAS program to compare the sales records of the company’s three sales people –
that is, compute the sum and mean for the number of visits, phone calls and units sold for
each salesperson.

ans;

libname mylib'E:\ast';
data mylib.Assessment;
input x1$ x2 x3 x4 x5;
datalines;
Brown American 3 12 28000
Johnson VRW 6 14 33000
Rivera Texam 2 6 8000
Brown Standard 0 22 0
Brown Knowles 2 19 12000
Rivera Metro 4 8 13000
Rivera Uniman 8 7 27000
Johnson Oldham 3 16 8000
Johnson Rondo 2 14 2000
;
run;
data mylib.Assessment;
set mylib.Assessment;
label x1='Salesperson'
x2='Target company'
x3='Number of visits'
x4='Number of phone calls'
x5='Units sold'
;
run;
proc print data=mylib.Assessment;
run;
proc sort data=mylib.Assessment;
by x1;
run;
proc means data=mylib.Assessment sum mean ;
by x1;
run;

2 comments:

  1. I think X1 is string, so what about the $ sign??? Please tell me...

    ReplyDelete
  2. BELHIN, It's my mistake. Thanks for your comment

    ReplyDelete