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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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