BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
lethcons
Obsidian | Level 7

When I run this code (SAS 9.4M5)

 

data a;
kkkkkkkkk='A';
xxxxxxxxx=1;
yyyyyyyyy=2;
output;
kkkkkkkkk='B';
xxxxxxxxx=11;
yyyyyyyyy=22;
output;  
run;

ods html close; 
ods html file="<path>\Report.html" style=meadow;

proc print data=a noobs;
var kkkkkkkkk xxxxxxxxx yyyyyyyyy;
sum xxxxxxxxx yyyyyyyyy;
run;

ods html close;

The output in the SAS Results window is as expected, but in Report.docx (attached, contains the output Report.html but cannot attach .html file here Smiley Frustrated) you will see the SUM figures are centred. This doesn't happen if I use style=default. I can't find any way of getting the SUM values right-justified. Can anyone please advise?

Many thanks.

-Howard

 

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  You need to add a STYLE override to your PROC PRINT statement:

proc print data=a noobs
  style(grandtotal)={just=r};
var kkkkkkkkk xxxxxxxxx yyyyyyyyy;
sum xxxxxxxxx yyyyyyyyy;
run;

 

Then you'll right justify the grand total from the SUM statement. Here's a paper that discusses style overrides with PRINT, REPORT and TABULATE: http://support.sas.com/resources/papers/proceedings13/366-2013.pdf .

 

Cynthia

View solution in original post

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

Hi:

  You need to add a STYLE override to your PROC PRINT statement:

proc print data=a noobs
  style(grandtotal)={just=r};
var kkkkkkkkk xxxxxxxxx yyyyyyyyy;
sum xxxxxxxxx yyyyyyyyy;
run;

 

Then you'll right justify the grand total from the SUM statement. Here's a paper that discusses style overrides with PRINT, REPORT and TABULATE: http://support.sas.com/resources/papers/proceedings13/366-2013.pdf .

 

Cynthia

lethcons
Obsidian | Level 7

Perfect Cynhia, thanks! I had tried playing with that but I must have had it in the wrong place.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 845 views
  • 0 likes
  • 2 in conversation