The SAS Output Delivery System and reporting techniques

different justification within in-line formatting

Reply
Occasional Contributor
Posts: 18

different justification within in-line formatting

Hi y'all

I'm in ods pdf, proc-report-ing, and I'm wanting to justify the first part of a line (a string) left, and the last part right.

Something like
proc report
data whatever;
columns ("^S={just=L}This part left^S={just=R}this part right" col1 col2 col3);


...I can't do this, can I? (sinking feeling)

Thanks

Tree Frog
SAS Super FREQ
Posts: 8,739

Re: different justification within in-line formatting

Hi:
See if this does the trick for you WITHOUT using ODS ESCAPECHAR. PROC REPORT gives you a way to produce "spanning headers" by just specifying the string you want BEFORE the variables you want the string to span. Try this code. I've included the LISTING dest version, as well, so you can see how it started:[pre]
ods listing close;
ods pdf file='c:\temp\spanhead.pdf';
proc report data=sashelp.shoes(obs=20) nowd;
column ('Something' region subsidiary) ('Something Else' product sales inventory);
run;
ods pdf close;

ods listing;
proc report data=sashelp.shoes(obs=20) nowd;
column ('-Something-' region subsidiary) ('-Something Else-' product sales inventory);
run;
[/pre]

I think this is close to what you want.
cynthia
SAS Employee
Posts: 50

Re: different justification within in-line formatting

After chatting with the Proc Report developer we found out that if you use two strings in the column statement you will get something that might be what you want.

Cynthia's is on one line while this one is on two lines.

Let us know!
Scott

ods pdf file = "test2.pdf";
ods escapechar = "^";
options orientation=landscape;
proc report data=sashelp.class nowd;
col ("^S={just=L}This part left" "^S={just=R}this part right" name sex age height weight);
define name--weight / display;
run;
ods pdf close;
Occasional Contributor
Posts: 18

Re: different justification within in-line formatting

Thanks - getting very close here, I think.

Cynthia's suggestion does what I'm after, but I'm hoping to apply that second approach (two separate strings enclosed in separate quotes) for some LINEs later in the report.

However, the 'just=' in-line style declaration doesn't seem to have any effect.

Try putting

compute after;
line "^S={just=L}This bit left" "^S={just=R}This bit right";
endcomp;

in a proc report step... or am I missing something?

TF
Ask a Question
Discussion stats
  • 3 replies
  • 167 views
  • 0 likes
  • 3 in conversation