- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Below is my proc tabulate code. I'd like the first variable in the table, the page variable 'cohort', to print with vertical alignment to save space. Can someone tell me how to do it? I've searched far and wide and have not found an answer yet.
Bill
**************** code ********************
proc tabulate data =&input f=4.0 S=[just=c cellwidth=75];
var Col1;
class cohort criterion instrument /ORDER=DATA ;
class _name_ ;
table cohort*instrument*criterion all={label='Total' s=[just=R background=lightblue]}*{s=[just=C background=lightblue]} ,(_name_='Level' ALL)*Col1=" "*(sum="N"*(f=cnum.) ROWPCTSUM="%"*f=mypct. ) /box=_PAGE_;
BY instrument NOTSORTED;
run;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
This paper suggests using VJUST. From the documentation, looks like you can specify VJUST=TOP, BOTTOM, or MIDDLE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
This paper suggests using VJUST. From the documentation, looks like you can specify VJUST=TOP, BOTTOM, or MIDDLE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I actually looked at that paper already and never noticed that line. It was right in front of my face! Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Update after actually trying the suggestion. Specifying Vjust does't work the way I want. It locates the horizontal text at the top, center or bottom of the box. I want to rotate the text so the text is printed vertically. I'm still stuck! Any other ideas?
Text should be like this:
A
n
s
w
e
r
and not like this. Answer
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Ah, so you want rotated text. Try this solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks. Can't get that to work, it gives an error message, maybe because I'm using this for a PDF output and that article is for an Excel worksheet?
I just created the style using this code from the article:
------------------ code from the suggested article to create a rotated text style -----------------------
proc template;
define style styles.mystyle;
parent=styles.default;
style vertical_header from header /
tagattr = 'rotate:90'
;
end;
run;
------------------ end of code from the suggested article to create a rotated text style -----------------------
Then I inserted that style where I want it, in the values for the cohort column. Gives an error. Not clear that proc tabulate will allow me to use styles that I create, or did I skip a step??
------------------------ my proc tabulate code to print a pdf file --------------------------------
proc tabulate data =&input f=4.0 S=[just=c cellwidth=70];
var Col1;
class cohort criterion instrument /ORDER=DATA ;
class _name_ ;
classlev cohort /style=[vertical_header];
table cohort*instrument*criterion all={label='Total' s=[just=R background=lightblue]}*{s=[just=C background=lightblue]} ,(_name_='Level' ALL)*Col1=" "*(sum="N"*(f=cnum.) ROWPCTSUM="%"*f=mypct. ) /box=_PAGE_;
BY instrument NOTSORTED;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Try including it in the PROC TABULATE call instead:
proc tabulate data=tabhow style=[vertical_header];
via this paper.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
it did work, it would apply to the entire table. I only want the values for
one of the three class columns to have vertical text. I want all the
headers to be normal and the other two class columns to have normal headers
and values. This is done in proc tabulate by using a classlev statement
and assigning the formatting there. Maybe this just can't be done.
##- Please type your reply above this line. Simple formatting, no
attachments. -##