BookmarkSubscribeRSS Feed
SM8
Obsidian | Level 7 SM8
Obsidian | Level 7

How can I use SAS to produce an Excel report with the following included in the report:

• Tabs for each business: BM part A, BM part b, BJ part a , BJ part b, and SSB 
• Case specific information: IDN, BSN, Doc_ID
• Date (dt) Ranging from  3/1/20 – 3/30/20

 

I'm new to SAS, but I do believe SQL would be easiest to complete this. Any advice/suggested code would be helpful. Thanks!

2 REPLIES 2
Kurt_Bremser
Super User

PROC REPORT has most, if not all options you need, and ODS EXCEL will give you control over sheet changes and sheet names (among others).

 

For detailed help, provide example data in usable form (data step with datalines), and an example for the expected result in Excel.

Cynthia_sas
Diamond | Level 26

Hi:

  Here's something to get you started. You could use SQL to generate the macro variables that I show with %LET statements in my program:

Cynthia_sas_0-1591832532994.png

 

  But I think that PROC REPORT gives you the most flexibility as far as using dynamic information for the sheet names, titles and table captions using the LINE statement.

 

  Cynthia

 

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 save with the early bird rate—just $795!

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
  • 2 replies
  • 1077 views
  • 1 like
  • 3 in conversation