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-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

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
  • 1038 views
  • 1 like
  • 2 in conversation