Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data z1;
- put _ALL_;
- set sashelp.class;
- put _ALL_;
- col1 = weight / 2;
- put _ALL_;
- run;
- data z2;
- set sashelp.cars end = koniec;
- *retain total 0; /* zapamietaj total = 0*/
- *total = total + invoice;
- total + invoice;
- keep total;
- if koniec then output;
- run;
- *przetwarzanie w grupach
- zlicz liczbê aut dla każdej marki;
- proc sort data = sashelp.cars out = cars;
- by make;
- run;
- data z3;
- set cars;
- by make;
- col1 = first.make;
- col2 = last.make;
- run;
- data z4;
- set sashelp.cars;
- by make;
- if first.make then do
- licznik = 0;
- suma = 0;
- end;
- licznik + 1;
- suma + invoice;
- if last.make then output;
- keep make licznik suma;
- run;
- *na podstawie sashelp.air zliczyĉ przewozy w latach;
- data z5;
- set sashelp.air;
- rok = year(date);
- run;
- data z6;
- set z5;
- by rok;
- if first.rok then suma = 0;
- suma + air;
- if last.rok then output;
- keep rok suma;
- run;
- *podaj 3 najdroższe auta dla każdej marki;
- proc sort data = sashelp.cars out = cars;
- by make descending invoice;
- run;
- data z7;
- set cars;
- by make;
- if first.make then licznik = 0;
- licznik + 1;
- if licznik <= 3 then output;
- run;
- proc sort data = sashelp.class out = class;
- by descending height;
- run;
- data zz1;
- set class;
- by sex;
- *if first.sex then output;
- run;
- data zz2;
- set sashelp.class;
- retain min min(height);
- delta_height = height - min;
- run;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement