The SAS Output Delivery System and reporting techniques

Creating a space or gap between certain columns

Reply
Frequent Contributor
Frequent Contributor
Posts: 139

Creating a space or gap between certain columns

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


SAS Super FREQ
Posts: 8,868

Re: Creating a space or gap between certain columns

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

Frequent Contributor
Frequent Contributor
Posts: 139

Re: Creating a space or gap between certain columns

Posted in reply to Cynthia_sas

Cynthia-

It's going to a PDF. I'll try it in the DEFINE statement in the interim.

Lawrence

Frequent Contributor
Frequent Contributor
Posts: 139

Re: Creating a space or gap between certain columns

Posted in reply to Cynthia_sas

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

SAS Super FREQ
Posts: 8,868

Re: Creating a space or gap between certain columns

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

Frequent Contributor
Frequent Contributor
Posts: 139

Re: Creating a space or gap between certain columns

Posted in reply to Cynthia_sas

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


Ask a Question
Discussion stats
  • 5 replies
  • 400 views
  • 3 likes
  • 2 in conversation