BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ShuShen
Calcite | Level 5
How to export sashelp.class to Excel 4 spreadsheet (Microsoft Excel 4 Spreadsheet)?
1 ACCEPTED SOLUTION

Accepted Solutions
Shmuel
Garnet | Level 18

Try next steps:

1) Open a new empty excel file with 4 sheets: shhet1-sheet4.

2) Adapt next code:

libname myxl excel "<path to the excel file>/filename.xlsx" replace;

data myxl.sheet1 myxl.sheet2 myxl.sheet3 myxl.sheet4;
 set sashelp.class;
       if <condition1> then output myxl.sheet1; else
       if <condition2> then output myxl.sheet2; else
       if <condition3> then output myxl.sheet3; else
       if <condition4> then output myxl.sheet4; 
run;

View solution in original post

2 REPLIES 2
Shmuel
Garnet | Level 18

Try next steps:

1) Open a new empty excel file with 4 sheets: shhet1-sheet4.

2) Adapt next code:

libname myxl excel "<path to the excel file>/filename.xlsx" replace;

data myxl.sheet1 myxl.sheet2 myxl.sheet3 myxl.sheet4;
 set sashelp.class;
       if <condition1> then output myxl.sheet1; else
       if <condition2> then output myxl.sheet2; else
       if <condition3> then output myxl.sheet3; else
       if <condition4> then output myxl.sheet4; 
run;
ShuShen
Calcite | Level 5
Thank you so much!!!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 575 views
  • 1 like
  • 2 in conversation