BookmarkSubscribeRSS Feed
m2l2
Calcite | Level 5

Screenshot 2023-10-13 at 9.28.57 PM.png

 

I know how to create the bottom listing under Row 9 by using proc report. But how to create those cells in yellow in one designated cell or designated merging cells as in the above screenshot? Is it doable in proc report title statement? 

If not, can I use data _null_ for that? Is it possible to use data _null_ for the top part and Proc Report for the bottom part?

@Cynthia_sas  @Ksharp 

3 REPLIES 3
Ksharp
Super User

If you don't require too much, could try this simple code:

 


data have;
array x{8} (8*1);
output;
output;
run;
ods excel file='c:\temp\x.xlsx';
proc report data=have nowd;
columns ('MDCG' 
('MS+NCA'  ('No. of subjects' ('Date of report' (' ' x1))))
(' '  (' ' x2))
(' ' (' ' x3))

('No. of subjects' (' ' (' ' x4))
(' ' (' ' x5)) )

(' ' (' '  x6))

('Reference Member' ('No. of Investion ' (' ' ('Description' x7 x8)))));
define _all_/display;
run;
ods excel close;

Ksharp_0-1697275498958.png

 

 

 

Otherwise , you need to resort to RWI skill:

https://communities.sas.com/t5/SAS-Programming/add-dummy-across-columns-header-in-proc-report/m-p/89...

https://communities.sas.com/t5/SAS-Programming/Proc-Report-Merge-Columns/m-p/889989

Patrick
Opal | Level 21

When it comes to a bit more involved Excel layouts and formatting then one way that often makes things easier to implement and maintain is to keep structure and data separated.

Have your reporting sheet with all the layout and a datasheet. You then create an Excel template with the report sheet that just got the structure and references to the cells in the data sheet. When you run your SAS program you create a copy of the template and create and populate the data sheet (if eventually hide the data sheet).

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for 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
  • 3 replies
  • 771 views
  • 0 likes
  • 3 in conversation