The SAS Output Delivery System and reporting techniques

Proc report header title

Reply
Regular Contributor
Posts: 237

Proc report header title

I have a proc report where I want to replace the column name by

define Jsc / 'Jsc (mA/cm2)';

but it splits after JSC?

Super User
Super User
Posts: 7,076

Proc report header title

Try adding a WIDTH option to make the column wide enough for your longer title.

You might also check what character you are using for you split character, but normally you would not use a space for that.

Super Contributor
Posts: 394

Proc report header title

Remember that the WIDTH option only works for listing output. For non-listing output like PDF or RTF, you'll need to use a STYLE option on the DEFINE statement and specify the WIDTH style attribute. See http://support.sas.com/documentation/cdl/en/odsug/61723/HTML/default/viewer.htm#a002972093.htm.

Regular Contributor
Posts: 237

Proc report header title

I tried width but as I use HTML to output it does not work...

So i tried:

define jsc / 'Jsc (mA/cm²)' STYLE=[CELLWIDTH=270]; (which is far too big)

but still my name gets splitted in the title..

Regular Contributor
Posts: 237

Proc report header title

solution: take a split charachter which is not / (default)

proc report SPLIT='+'

Occasional Contributor
Posts: 6

Proc report header title

Hey Filipvdr,

If you do not specify a width= statement in your define statement, the column headline will break after the longest value in the column.

E.g. the variable sex in sashelp.class dataset has a maximum length of 1, so the column length is one. If you add a label you need to define the column width like the width of the label. (Even the unlabeled variable name sex needs a width option to be displayed correctly.)

See the following comparision:

proc report data=sashelp.class;

   column name sex age weight height;

   define sex / 'Gender';

run;

Sex in the basic dataset is either 'M' or 'F' with the maximum width of 1. So the column header has a width of 1.

proc report data=sashelp.class;

   column name sex age weight height;

   define sex / display 'Gender' width=6;

run;

The assigned label 'Gender' has a width of 6 characters and with the corresponding width option you can expand the header.

Smiley Happy

Niels

SAS Super FREQ
Posts: 8,868

Re: Proc report header title

Posted in reply to SAS_Niels

Hi,

  As Tim pointed out, WIDTH= option of PROC REPORT only has an impact on LISTING output. Since the OP said he wanted HTML output, the WIDTH= option would not work. Instead, a combination of changing the default split character (a /) and using CELLWIDTH should get him what he wants. In the attached screen shots, examp_width1.jpg shows code that used LISTING and HTML. Without WIDTH=, the label 'Gender' does behave as you describe, but only for the LISTING output. As you can see, in the HTML output, the label appears correctly. However, because the split character is defined as / (the default), the label string for NAME splits at the slash in the label.

  With the SPLIT= redefined, and an explicit CELLWIDTH, the header for NAME is as desired and the header for SEX is fine without a WIDTH= option. The units for CELLWIDTH can be specified as pixels, points, inches or centimeters. I usually don't mess with pixels and I just go with inches as the unit.

  In addition to WIDTH=, there are other PROC REPORT options that only work in the LISTING destination, these are: FLOW, PANELS, BOX, DOL, DUL, OL, UL, SKIP, HEADLINE, HEADSKIP, WIDTH, SPACE, LS, PS. See this Tech Support note for more information:

http://support.sas.com/kb/2/549.html

http://support.sas.com/kb/23/671.html

http://support.sas.com/rnd/base/ods/templateFAQ/report1.html

cynthia


examp_width1.jpgexamp_width2.jpg
Ask a Question
Discussion stats
  • 6 replies
  • 331 views
  • 0 likes
  • 5 in conversation