Womee

Untitled

Jan 26th, 2020
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SAS 1.99 KB | None | 0 0
  1. *null;
  2. data z1;
  3.     set sashelp.electric;
  4.     *where alltip = '';
  5.     *where allpower = .;
  6.     where allpower < -9999999999999;
  7. run;
  8.  
  9. *instrukcja if;
  10. data z2;
  11.     set sashelp.cars;
  12.     IF MSRP <= 25000 then klasa = 'tani';
  13.     IF MSRP > 25000 and MSRP <= 75000 then klasa = 'sredni';
  14.     IF MSRP > 75000 then klasa = 'drogi';
  15. run;
  16.  
  17. data z3;
  18.     set sashelp.cars;
  19.     IF MSRP <= 25000 then klasa = 'tani';
  20.     ELSE IF <= 75000 then klasa = 'sredni';
  21.     ELSE klasa = 'drogi';
  22. run;
  23.  
  24. data z4;
  25.     set sashelp.cars;
  26.     length klasa $20
  27.            rabat 8;
  28.     IF MSRP <= 25000 then do;
  29.         klasa = 'tani';
  30.         rabat = 0.25;
  31.     end;
  32.     ELSE IF <= 75000 then do;
  33.         klasa = 'sredni';
  34.     end;
  35.     ELSE do;
  36.         klasa = 'drogi';
  37.     end;
  38. run;
  39.  
  40. data z5;
  41.     set sashelp.cars;
  42.     if make = 'Audi' then output;
  43. run;
  44.  
  45. data z6 z7;
  46.     set sashelp.class;
  47.     if sex = 'F' then output z6;
  48.     else output z7;
  49. run;
  50.  
  51. data z8 z9 z10;
  52.     set sashelp.class;
  53.     where weight > 105;
  54.     output z8;
  55.     if sex = 'F' then output z9;
  56.     if sex = 'M' then output z10;
  57. run;
  58.  
  59. proc sort data = sashelp.cars out = audi;
  60.     where make = 'Audi';
  61.     by descending horsepower;
  62. run;
  63.  
  64. proc sort data = sashelp.cars out = audi;
  65.     where make = 'Audi';
  66.     by type descending msrp;
  67. run;
  68.  
  69. data z11;
  70.     set sashelp.cars;
  71.     coll = _N_;
  72. run;
  73.  
  74. *formaty;
  75. data z12;
  76.     a = 12345.67;
  77.     b = 12345.67;
  78.     c = 0.567;
  79.     d = 12345.678;
  80.     format a commax12.2 b comma12.2 c percent12.2
  81.     d date9. ;
  82. run;
  83.  
  84. *put input
  85. zmienna_znakowa = put(zmienna, format)
  86. zmienna_numeryczna = input(zmienna, informat);
  87.  
  88. data z13;
  89.     a = 150;
  90.     b = put(a, 6.);
  91.     c = input(b, 8.);
  92. run;
  93.  
  94. libname Z 'C:\Users\student\Desktop\Z';
  95.  
  96. data Z.Z1;
  97.     set sashelp.class;
  98.     length plec $20;
  99.     if sex = 'F' then plec = 'Kobieta';
  100.     else if sex = 'M' then plec = 'Mezczyzna';
  101. run;
  102.  
  103. data Z.Z2;
  104.     set sashelp.cars;
  105.     length Class $20;
  106.     if horsepower <= 130 then Class = 'wolny';
  107.     else if horsepower <= 200 then Class = 'normalny';
  108.     else Class = 'szybki';
  109.     roznica = abs(200 - horsepower);
  110. run;
  111.  
  112. data Z.Z3;
  113.     set sashelp.cars;
  114.     if msrp
Add Comment
Please, Sign In to add comment