Left-aligning PROC REPORT output

By default, if you use OPTIONS NOCENTER to generate left-aligned plain text output from PROC REPORT, you will get something like this:

This is title line one This is title line two ------------------------------------------ Subject ID DOB Age ------------------------------------------ 10010001 01JAN1969 38 10010002 05MAR1984 23 ------------------------------------------ Footnote 1

The body of the table doesn't align with the titles and footnotes. This is because PROC REPORT applies the default column spacing to the left of each column; the first column's spacing causes the entire table to be offset to the right when compared to the titles and footnotes. To avoid this, simply specify "spacing=0" on the left-most column's define statement:

define subjid / "Subject ID" spacing=0;

which will give you:

This is title line one This is title line two ------------------------------------------ Subject ID DOB Age ------------------------------------------ 10010001 01JAN1969 38 10010002 05MAR1984 23 ------------------------------------------ Footnote 1

Comments