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

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 975 views
  • 1 like
  • 3 in conversation