Advertisement
elena1234

export results to Excel in SAS

Apr 8th, 2023 (edited)
1,511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SAS 0.98 KB | Source Code | 0 0
  1. /* 1. The folder "Export" is already created in my home directory; */
  2.  
  3. ___________________________________________________________________________________________________
  4. /* First option */
  5. /* Summary Statistics */
  6. proc means data=STPSAMP.STPEURO stackodsoutput mean stddev min max skewness kurtosis;
  7. var pop growth birth death imm lifeexp;
  8. ods output summary = want;
  9. run;
  10.  
  11. proc export data=want outfile = "/home/u63376027/Export/Summary_Stats.xlsx" dbms = xlsx replace;
  12. run;
  13.  
  14. ___________________________________________________________________________________________________
  15. /* Second option */
  16. /* Histograms of the all variables" */
  17. ods excel file='/home/u63376027/Export/Histograms.xlsx' style=seaside;
  18.  
  19. title 'Population Histogram';
  20. proc sgplot data=STPSAMP.STPEURO;
  21.     histogram pop;
  22.     density pop/ type=normal;
  23. run;
  24.  
  25. title 'Growth Rate Histogram';
  26. proc sgplot data=STPSAMP.STPEURO;
  27.     histogram growth;
  28.     density growth/ type=normal;
  29. run;
  30. ods excel close;
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement