How to get SAS data into excel using different variable names?
A simple example
ods excel file="newfile.xlsx";
proc print data=sashelp.class(rename=(height=tallness weight=heaviness sex=gender));
run;
ods excel close;
Please provide an example of your current variable names and what you expect the result to be.
Depends on the way you used to export the dataset. So please post the code you have, so that we can suggest something working in your setup.
Have a look at docs the rename-statement and/or the rename-option.
A simple example
ods excel file="newfile.xlsx";
proc print data=sashelp.class(rename=(height=tallness weight=heaviness sex=gender));
run;
ods excel close;
EXCEL files do not have variables.
Are you asking how to make an Excel sheet with column headers that are different than the variable names in the source dataset?
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.