sas 20210514

data a;
set sashelp.class;
proc print;

data test1;
x=-314;
abs_x=abs(x);
mod_x=mod(31,4);
max_x=max(-314,-87,0,1127);
proc print;

data date;
x=date();
y=today();
format x y yymmdd10.;
put x= y=;
proc print;

data ymd;
DATE=DATE();
year=year(date);
qtr=qtr(date);
month=month(date);
day=day(date);
weekday=weekday(date);
format date yymmdd10.;

hour=hour(DATETIME());
minute=minute(DATETIME());
second=second(DATETIME());
proc print;

libname work list;

data two;
infile '/folders/myfolders/exercise5.txt';
input name$ age type$ date$10. score1-score5;
type=upcase(type);
avg=mean(score1,score2,score3,score4,score5);
std=std(score1,score2,score3,score4,score5);
max=max(score1,score2,score3,score4,score5);
for do i=1 to 5 by 1;
if score[i]=max then do;
drop score[i];
end;
end;
drop max;
proc print;

 

 

data ymd;
DATE=DATE();
year=year(date);
qtr=qtr(date);
month=month(date);
day=day(date);
weekday=weekday(date);
format date yymmdd10.;

proc print;

data two;
infile '/folders/myfolders/exercise5.txt';
input name$ age type$ date yymmdd10. score1-score5;
weekday=weekday(date);
format date yymmdd10.;
type=upcase(type);
avg=mean(score1, score2, score3, score4, score5);
std=std(score1, score2, score3, score4, score5);
proc print;

data five_1;
set two;
where weekday=2 and type='C';
PROC PRINT;

posted @ 2021-05-14 10:36  AnXiaoni  阅读(53)  评论(0)    收藏  举报