BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Aayushi_17
Quartz | Level 8

Hi ,

 

In proc export for excel I have given sheet name as

sheet='Value Level Terminology';

 

But am getting the output in excel sheet as

 

'Value_Level_Terminology';

 

I dont want this '_ ' between the sheet names.Does anyone know how to get the output as 'variable mapping'. thanks in advance.

 

1 ACCEPTED SOLUTION

Accepted Solutions
andreas_lds
Jade | Level 19

@Aayushi_17 wrote:

am using 9.4 version.

 

proc export data=d_outi.variable
outfile='C\newfolder\pricesheet.xls'
label dbms=xls replace;
sheet='variable label';
run;

 

this is the code i used to export the excel file


 

The options mentioned by @SASKiwi  don't solve the issue seems to be a feature when creating files in the outdated excel-format xls. Can you change to xlsx?

 

proc export data=sashelp.class
      outfile="PATH\class.xlsx"
      label dbms=xlsx replace;
   sheet='variable label';
run;

View solution in original post

8 REPLIES 8
SASKiwi
PROC Star

Try adding this OPTIONS statement before your export code:

options validvarname = any validmemname = extend;
Aayushi_17
Quartz | Level 8

I tired this but still getting the same output

 

andreas_lds
Jade | Level 19

Please post the code used to export the file. Which SAS version are you using?

Aayushi_17
Quartz | Level 8

am using 9.4 version.

 

proc export data=d_outi.variable
outfile='C\newfolder\pricesheet.xls'
label dbms=xls replace;
sheet='variable label';
run;

 

this is the code i used to export the excel file

andreas_lds
Jade | Level 19

@Aayushi_17 wrote:

am using 9.4 version.

 

proc export data=d_outi.variable
outfile='C\newfolder\pricesheet.xls'
label dbms=xls replace;
sheet='variable label';
run;

 

this is the code i used to export the excel file


 

The options mentioned by @SASKiwi  don't solve the issue seems to be a feature when creating files in the outdated excel-format xls. Can you change to xlsx?

 

proc export data=sashelp.class
      outfile="PATH\class.xlsx"
      label dbms=xlsx replace;
   sheet='variable label';
run;
Aayushi_17
Quartz | Level 8

Thanks this one worked

Satish_Parida
Lapis Lazuli | Level 10
The only difference between the codes are dbms=xls(old) and dbms=xlsx. How this fixed this issue?
Asking this to get a clear clarification.
andreas_lds
Jade | Level 19

@Satish_Parida wrote:
The only difference between the codes are dbms=xls(old) and dbms=xlsx. How this fixed this issue?
Asking this to get a clear clarification.

Could be a bug/feature in proc export. Afaik xls supports blanks in sheet-names. You will need to contact tech-support for more information.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 11611 views
  • 2 likes
  • 4 in conversation