Skip to content

Instantly share code, notes, and snippets.

@joosti
Last active August 29, 2015 14:12
Show Gist options
  • Select an option

  • Save joosti/642c18f16b5cecb3a261 to your computer and use it in GitHub Desktop.

Select an option

Save joosti/642c18f16b5cecb3a261 to your computer and use it in GitHub Desktop.
SAS macro variables
/* variable assignments */
%let tableDir = C:\myProject\sas_output\;
%let vars = roa roe asset_turn;
/* create descriptive statistics */
proc means data=myDataset NOPRINT;
output out=table1 mean= median= std= min= max= p25= p75= N=/autoname;
var &vars;
run;
/* export to table_1.csv in &tableDir */
proc export data=table1 OUTFILE="&tableDir.table_1.csv" dbms=csv replace;
run;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment