sas2021.4.9

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;

 

posted @ 2021-04-09 10:42  AnXiaoni  阅读(55)  评论(0)    收藏  举报