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

Hello

In this example I create multiple prints (by group)

I have 1 questions:

1-I want to have empty line between the print outputs

When I do copy and paste it into excel the prints are all connected and I want to have empty line between outputs

2-I want to color value under PCT column in last row of each print:

IF value>39% then it will have red background color.

IF value<=39% then it will have green  background color.

 

data aaa;
input ID  group $ Y;
cards;
1 a 10
2 a 20
3 a 30
4 a 40
5 b 50
6 b 60
7 b 70
8 c 80
9 c 90
10 c 100
;
run;
data bbb;
   set aaa; 
   by group;
   if first.group then total=0;
   total + y;
   PCT=y/total;
   format PCT percent9.2;
run;
title;
proc print data=bbb  noobs;
by group;
id group;
run;
1 ACCEPTED SOLUTION

Accepted Solutions
Shmuel
Garnet | Level 18

Try

title1 'My Title';
proc print data=bbb  noobs;
by group;
id group;
run;

footnote1 ' E - N - D ';
footnote2 '               ';

View solution in original post

5 REPLIES 5
Shmuel
Garnet | Level 18

You can add FOOTNOTEs in order to have space between IDs.

Ronein
Onyx | Level 15

I tried to use footnote but I don't see any difference

title;
proc print data=bbb  noobs;
by group;
id group;
footnote;
run;
Shmuel
Garnet | Level 18

Try

title1 'My Title';
proc print data=bbb  noobs;
by group;
id group;
run;

footnote1 ' E - N - D ';
footnote2 '               ';
andreas_lds
Jade | Level 19

You will have to change the template used to increase the space between tables. Depending on the output-format you are using, using CSS can help - i never did it, so this is just how i would try to solve the problem.

 

There are so many papers about how to change background color of cells and rows, i am sure you can find examples.

 

EDIT: The title; statement resets all title-statements executed before. The footnote; has the same effect on footnotes.

Ronein
Onyx | Level 15

Thank you so much.

I see that for example IF I want to  have 3 lines of space between the printed tables then I need to have 3 footnote statements.

for example:

 

footnote;
footnote1 '               ';
footnote2 '               ';
footnote3 '               ';
title;
title1 'XXXXXX';
proc print data=sashelp.cars(where=(Type="SUV")) noobs;run;

title;
title1 'YYYY';
proc print data=sashelp.cars(where=(Type="SUV")) noobs;run;

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