Hello all-
How do I go about creating a small gap between certain columns,
So that for example when I have a columns
('Process A' a1 a2 a3) ('Process B" B1 B2 B3) I can insert a small white gap in between?
I saw an exampe by Art Carpenter online but have not been able to find it again.
Thanks.
Lawrence
Hi:
Here's the thing...it depends on the destination. If you were using the LISTING destination, then the SPACING= option on the DEFINE statement in PROC REPORT would give more spacing between columns. In other destinations, you have to do other methods. Most notable would be CELLWIDTH= or WIDTH= to make a column wider, in destinations that support style overrides. What is your destination of interest?
cynthia
Cynthia-
It's going to a PDF. I'll try it in the DEFINE statement in the interim.
Lawrence
Cynthia;
Spacing does not seem to work.
Also be aware that this is building on a prior thread with the fake spanners that you helped with with before.
So playing with it, I created another fake column-with blank values called emp in the dataset-And then in the PROC REPORT:
columns statement include:
emp,_emp
where in the DEFINE statement-
DEFINE EMP/ ACROSS ' ' width=7 style(header)={background=white};
DEFINE _EMP/ ' ' width=7 style(header)={background=white} style(column)={background=white color=white};
It mostly works except that the header color won't render correctly for EMP..
Thanks again.
Lawrence
Hi:
The trouble is that PROC REPORT for the LISTING destination ONLY has SPACING= and WIDTH=. Those options WILL not work in non-LISTING destinations. So your simple WIDTH= will not work. For HTML, RTF, PDF, etc, you would have to do:
define myvar / 'My header'
style(column)={cellwidth=1in };
OR
define myvar / 'My header'
style(column)={width=1in};
But your CELLWIDTH or WIDTH style attribute must be specified within the STYLE override - not just out on the DEFINE statement, as you show. BTW, you can't have 2 DEFINE statements for EMP -- only 1 allowed. The last one will "win", which, I suspect, is not what you want. You may find that if you use CELLWIDTH/WIDTH, you may not need your "fake" spacer column, so the header color issue won't be an issue.
If you are running SAS 9.1.3, you will need to use the CELLWIDTH attribute in your style override. If you are using 9.2 or higher, then either CELLWIDTH or WIDTH will work. I tend to use CELLWIDTH, because then I don't get myself confused with the "old" WIDTH= option that only works in LISTING.
cynthia
Cynthia-
This helps immensely although with the "fake headers"-it simply works on one level only and not the other. So I may have to create a fake column after all.
Thanks again for all your hard work.
Lawrence
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.