data customers;
infile'C:\Documents and Settings\mobileclub\Desktop\source\DLM\customers.txt';
input cno $ bcd $ pcd $ month goods;
run;
proc sql;
select distinct (cno) as cl 'customer list' from customers;
quit;
proc sql;
select distinct (bcd) as bl 'branch list' from customers;
quit;
proc sql;
select distinct (pcd) as pl 'product list' from customers;
quit;
data qw;
input x;
cards;
23.45
67.89
22.45
28.23
-23.65
;
proc sql;
select * ,
int(X) as it,
round(X) as r1,
round(X ,.1) as r2,
ceil(X) as c,
floor(X) as fr,
abs(X) as ab,
log (X) as log1,
log10(X) as lg2 from qw;
quit;
data ps;
input pcd jsale fsale msale ;
cards;
101 230 320 310
102 340 320 210
103 560 450 340
;
proc sql;
select pcd,sum(jsale,fsale,msale) as ts 'total sale',
mean(jsale,fsale,msale) as ags 'average sale',
max(jsale,fsale,msale) as mx 'maximum sale',
min(jsale,fsale,msale) as mn'minimum sale',
std(jsale,fsale,msale) as sd'standardad devi in sale' from ps;
quit;
proc sql;
select 'january' as month,
sum(jsale) as ts 'totalsale',
mean(jsale) as ags 'average sale',
max(jsale) as mx 'maximum sale',
min(jsale) as mn'minimum sale',
std(jsale) as sd'standardad devi in sale' from ps
union all
select 'february' as month,
sum(fsale) as ts 'totalsale',
mean(fsale) as ags 'average sale',
max(fsale) as mx 'maximum sale',
min(fsale) as mn'minimum sale',
std(fsale) as sd'standardad devi in sale' from ps
union all
select 'march' as month,
sum(msale) as ts 'totalsale',
mean(msale) as ags 'average sale',
max(msale) as mx 'maximum sale',
min(msale) as mn'minimum sale',
std(msale) as sd'standardad devi in sale' from ps;
quit;
No comments:
Post a Comment