Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data z1;
- put _ALL_;
- set sashelp.class;
- put _ALL_;
- weight2=weight/2;
- put _ALL_;
- run;
- *kolumny zliczeniowe,wartosc aut;
- data z2;
- set sashelp.cars;
- *retain total 0; /*retain nazwa wartoลฤ*/
- *total = total + invoice;
- total + invoice;
- if koniec then output;
- keep total;
- run;
- *przetwarzanie w grupach ;
- proc sort data = sashelp.cars out=cars;
- data z3;
- set sashelp.cars;
- by make; /* przetwarzanie w grupach */
- *col1=first.make;
- *col2=last.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;
- *sashelp.air;
- data z4;
- set sashelp.air;
- rok=year(date);
- run;
- data z5;
- set z4;
- by rok;
- if first.rok then suma =0;
- suma +air;
- if last.rok;
- keep rok suma;
- run;
- *podaj 3 najdrozsze auta dla kazdej marki;
- proc sort data = sashelp.cars
- out=cars;
- by make descending invoice;
- run;
- data z6;
- set cars z6;
- by make;
- if first.make then licznik =0;
- licznik +1;
- if licznik <=3 then out = cars;
- run;
- proc sort data = sashelp.class;
- out=class;
- by make descending invoice;
- run;
- data z7;
- set class z7;
- by height;
- if first.height then output max;
- if last.height then output = min;
- run;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement