Womee

Untitled

Jan 25th, 2020
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SAS 1.31 KB | None | 0 0
  1. libname S 'C:\Users\student\Desktop\test';
  2.  
  3. *data step;
  4. data S.zbior1;
  5.     tekst = "dzien dobry";
  6.     rok = 2019;
  7. run;
  8.  
  9. *wiecej obserwacji;
  10. data S.zbior2;
  11.     tekst = "dzien bardzo z³y";
  12.     rok = 2019;
  13.     output;
  14.     tekst = "trzeci rok";
  15.     rok = 2020;
  16.     output;
  17. run;
  18.  
  19. data zbior3;
  20.     tekst = "dzien dobry";
  21.     rok = 2019;
  22. run;
  23.  
  24. *proc step;
  25. proc contents data = S.zbior2;
  26. run;
  27.  
  28. proc print data = S.zbior2;
  29. run;
  30.  
  31. *przetwarzanie danych;
  32. data S.zbior4;
  33.     set sashelp.class;
  34.     bmi = weight / (height * height) * 703;
  35.     rok = '01JAN2019'd;
  36. run;
  37.  
  38. data S.zbior5;
  39.     set sashelp.class;
  40.     name2 = sex || name;
  41.     label  name2 = "d³uga nazwa";
  42. run;
  43.  
  44. data S.zbior6;
  45.     set sashelp.cars;
  46.     where make = "Audi";
  47. run;
  48.  
  49. data S.zbior6;
  50.     set sashelp.cars;
  51.     where make = 'Audi' and type = 'Sedan';
  52. run;
  53.  
  54. data S.zbior7;
  55.     set sashelp.airline;
  56.     where date <= '01JAN1959'd;
  57. run;
  58.  
  59. data S.zbior8;
  60.     set sashelp.cars;
  61.     *keep name sex;
  62.     keep m: ;
  63. run;
  64.  
  65. data S.zbior9;
  66.     set sashelp.cars;
  67.     drop m: ;
  68. run;
  69.  
  70. data S.chlopcy(keep = name age) S.dzwieczyny(drop = sex);
  71.     set sashelp.class(keep = name age sex);
  72. run;
  73.  
  74. data S.klasa;
  75.     set sashelp.class(where = (sex = 'F'))
  76.         sashelp.class(where = (sex = 'M'));
  77. run;
  78.  
  79. data toyota(where = (upcase(make) = 'TOYOTA'))
  80.     audi(where = (lowcase(make) = 'audi'));
  81.     set sashelp.cars;
  82. run;
Add Comment
Please, Sign In to add comment