• 微信公众号:美女很有趣。 工作之余,放松一下,关注即送10G+美女照片!

sas2021.4.9

开发技术 开发技术 2周前 (04-09) 5次浏览

data a;
set sashelp.class;
keep name sex age;
rename name=nam;
proc print;

data b;
set sashelp.class;
retain max_age 0;
if age>max_age then max_age=age;
proc print max_age;
run;

data a(keep=name height s_h);
set sashelp.class;
s_h=sum(s_h,height);
/*retain s_h 0;*/
proc print data=a(obs=5);

data a(keep=name height s_h);
set sashelp.class;
s_h=0;
s_h=sum(s_h,height);
proc print data=a(obs=5);

data a(keep=name height s_h);
set sashelp.class;
s_h=s_h+height;
/*retain s_h 0;*/
proc print data=a(obs=5);

data a(keep=name height s_h);
set sashelp.class;
s_h=0;
s_h=s_h+height;
/*retain s_h 0;*/
proc print data=a(obs=5);

data a(keep=name height s_h);
set sashelp.class;
s_h+height;
/*retain s_h 0;*/
proc print data=a(obs=5);

data a(keep=name height s_h);
set sashelp.class;
retain s_h 0;
s_h=sum(s_h,height);
proc print data=a(obs=5);

data team;
input Date $ Name&$19. Hits Runs;
cards;
6-19 Columbia Peaches 8 3
6-20 Columbia Peaches 10 5
6-23 Plains Peanuts 3 4
6-24 Plains Peanuts 7 2
6-25 Plains Peanuts 12 8
6-30 Gilroy Garlics 4 4
7-1 Gilroy Garlics 9 4
7-4 Sacramento Tomatoes 15 9
7-4 Sacramento Tomatoes 10 10
7-5 Sacramento Tomatoes 2 3
;
proc print;

data a(keep=Date Name Hits Runs);
set team;
SumRuns+Runs;
proc print;

data team;
input Date $ Name&$19. Hits Runs;
SumRuns+Runs;
cards;
6-19 Columbia Peaches 8 3
6-20 Columbia Peaches 10 5
6-23 Plains Peanuts 3 4
6-24 Plains Peanuts 7 2
6-25 Plains Peanuts 12 8
6-30 Gilroy Garlics 4 4
7-1 Gilroy Garlics 9 4
7-4 Sacramento Tomatoes 15 9
7-4 Sacramento Tomatoes 10 10
7-5 Sacramento Tomatoes 2 3
;
proc print;

 


程序员灯塔
转载请注明原文链接:sas2021.4.9
喜欢 (0)