Bosssu

Untitled

Nov 24th, 2017
288
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ods rtf file="/folders/myfolders/project/output.rtf";
  2. /*Objective 1*/
  3. proc import datafile="/folders/myfolders/project/Ana.xlsx"
  4. out=project dbms=xlsx replace;
  5. sheet="Sheet1";
  6. getnames=YES;
  7. run;
  8. proc univariate data=project normal;
  9. var Branch1;
  10. title "Branch 1";
  11. run;
  12. proc univariate data=project normal;
  13. var Branch2;
  14. title "Branch 2";
  15. run;
  16. proc univariate data=project normal;
  17. var Branch3;
  18. title "Branch 3";
  19. run;
  20. data Branch;
  21. input Branch$ Sales@@;
  22. datalines;
  23. 1 16 2 85 3 14
  24. 1 17 2 67 3 12
  25. 1 7 2 6 3 12
  26. 1 12 2 24 3 53
  27. 1 121 2 123 3 6
  28. 1 86 2 84 3 21
  29. 1 72 2 127 3 0
  30. 1 37 2 101 3 4
  31. 1 26 2 37 3 0
  32. 1 20 2 2 3 0
  33. 1 31 2 101 3 4
  34. 1 51 2 63 3 53
  35. 1 10 2 40 3 54
  36. 1 70 2 100 3 33
  37. 1 20 2 78 3 0
  38. 1 34 2 14 3 38
  39. 1 23 2 15 3 0
  40. 1 68 2 17 3 3
  41. 1 3 2 93 3 31
  42. 1 9 2 102 3 0
  43. 1 28 2 25 3 10
  44. 1 8 2 53 3 5
  45. 1 7 2 25 3 52
  46. 1 12 2 2 3 0
  47. 1 32 2 45 3 37
  48. 1 76 2 146 3 10
  49. 1 24 2 287 3 12
  50. 1 131 2 44 3 1
  51. 1 212 2 85 3 24
  52. 1 22 2 33 3 681
  53.  
  54. ;
  55. proc npar1way data=Branch;
  56. class Branch;
  57. var Sales;
  58. run;
  59. /*Objective 2*/
  60. proc import datafile="/folders/myfolders/project/Date.xlsx"
  61. out=Date dbms=xlsx replace;
  62. sheet="Sheet1";
  63. getnames=YES;
  64. run;
  65. proc sort data=Date;
  66. by Date;
  67. run;
  68. proc transpose data=Date out=Datelong name=Date1;
  69. by Date;
  70. var Branch1 Branch2 Branch3;
  71. run;
  72. proc freq data=Datelong;
  73. tables Date1*Date*col1/ cmh2 scores=rank;
  74. run;
  75. /*Objective 3*/
  76. proc import datafile="/folders/myfolders/project/Ana3.xlsx"
  77. out=project3 dbms=xlsx replace;
  78. sheet="Sheet1";
  79. getnames=YES;
  80. run;
  81. data project3;
  82. set project3;
  83. Branch123 = Branch1+Branch2+Branch3;
  84. proc npar1way data=project3;
  85. class Half;
  86. var Branch123;
  87. run;
  88. ods rtf close;
RAW Paste Data