The SAS Output Delivery System and reporting techniques

Proc Report sidenote

Reply
N/A
Posts: 0

Proc Report sidenote

Hello,

is it possible to have a note running vertically (from bottom to top, 90 degree angle) to the left of a chart (IE, running up the the outside, on the left of a chart)? If so how do I do this in proc report?

So for example (see below, sorry for the bad example), I want to position a note with the word NOTE, running up the left side of the chart produced in proc report. I want the text to be worded in a 90 degree angle.

Thx

_MY CHART_
E |data|data|data|
T |data|data|data|
O |data|data|data|
N |data|data|data|
SAS Super FREQ
Posts: 8,864

Re: Proc Report sidenote

Posted in reply to deleted_user
Hi:
I'm confused. Charts and plots are created with SAS/GRAPH procedures or SG Procedures -- not with PROC REPORT. So I'm wondering what you mean.

Generally, if you use SAS/GRAPH device-based procedures, such as PROC GCHART or GPLOT, then you can use either ANGLE and ROTATE options for AXIS Labels or you can explicitly put text onto the graph area with the ANNOTATE facility. However, that is for Graphical output.

For TABULAR output -- such as you would create with PROC REPORT, I am having a hard time visualizing how having such a note would even be needed for a tabular report.

Can you share the code that you are using or that produces the "chart" to which you want to add a note???? If you have proprietary data, then you can try to replicate your "chart" or "table" using SASHELP.CLASS or SASHELP.SHOES or SASHELP.HEART.

cynthia
N/A
Posts: 0

Re: Proc Report sidenote

Posted in reply to Cynthia_sas
Hi Cynthia,

Thx for your reply. It's tabular data, not a chart. I've provided the code below.

So, what I'm trying to do is have text run against the outside of the table, on the left side, running from bottom to top, 90 degree angle. I was thinking this might be possible using

"compute ?/? ;
line 'TEXT HERE'; "

But I can't get teh placement right.

Thx,

Scott



proc report data = work.error_ct;

columns
CS Scenario_Name Revenue_Impact &comm_mon_fri5 &comm_mon_fri4 &comm_mon_fri3 &comm_mon_fri2 &comm_mon_fri
Monthly_Impact;


title1 Weekly Commercial Monitoring Report - &comm_mon_fri;
define CS / display center;
define Scenario_Name / display 'Scenario Name';
define Revenue_Impact / display center 'Revenue Impact';
define &comm_mon_fri5 / display center format = comma10.;
define &comm_mon_fri4 / computed;
define &comm_mon_fri4 / display center format = comma10.;
define &comm_mon_fri3 / computed;
define &comm_mon_fri3 / display center format = comma10.;
define &comm_mon_fri2 / computed;
define &comm_mon_fri2 / display center format = comma10.;
define &comm_mon_fri / computed;
define &comm_mon_fri / display center format = comma10.;
define Monthly_Impact / display 'Monthly Impact' center;

footnote j=l 'A green background = Error set decreased by 10%';
footnote2 j=l 'A red background = Error set increased by 10%';
footnote3 j=l 'LEGEND';

compute &comm_mon_fri4;
if (((&comm_mon_fri5-&comm_mon_fri4)/&comm_mon_fri5)*100) < -10
and &comm_mon_fri5 <> 0
then
call define(_col_,"style", "style=[background=red]");
else if(((&comm_mon_fri5-&comm_mon_fri4)/&comm_mon_fri5)*100) > 10
and &comm_mon_fri5 <> 0
then
call define(_col_,"style",
"style=[background=green]");
endcomp;

compute &comm_mon_fri3;
if (((&comm_mon_fri4-&comm_mon_fri3)/&comm_mon_fri4)*100) < -10
and &comm_mon_fri4 <> 0
then
call define(_col_,"style", "style=[background=red]");
else if (((&comm_mon_fri4-&comm_mon_fri3)/&comm_mon_fri4)*100) > 10
and &comm_mon_fri4 <> 0
then
call define(_col_,"style",
"style=[background=green]");
endcomp;

compute &comm_mon_fri2;
if (((&comm_mon_fri3-&comm_mon_fri2)/&comm_mon_fri3)*100) < -10
and &comm_mon_fri3 <> 0
then
call define(_col_,"style", "style=[background=red]");
else if (((&comm_mon_fri3-&comm_mon_fri2)/&comm_mon_fri3)*100) > 10
and &comm_mon_fri3 <> 0
then
call define(_col_,"style",
"style=[background=green]");
endcomp;

compute &comm_mon_fri;
if (((&comm_mon_fri2-&comm_mon_fri)/&comm_mon_fri2)*100) < -10
and &comm_mon_fri2 <> 0
then
call define(_col_,"style", "style=[background=red]");
else if (((&comm_mon_fri2-&comm_mon_fri)/&comm_mon_fri2)*100) > 10
and &comm_mon_fri2 <> 0
then
call define(_col_,"style",
"style=[background=green]");
endcomp;

run;
SAS Super FREQ
Posts: 8,864

Re: Proc Report sidenote

Posted in reply to deleted_user
Hi:
You did not say what your destination of interest is (LISTING, HTML, RTF, PDF, etc), but really the solution depends on the ultimate destination. If you wanted something only in the LISTING destination (or Output Window) -- my guess is that it's just not possible.

I can envision 2 ways to do -something- similar to what you want, illustrated below for ODS HTML (view in a browser):
1) make an image (using a paint program) with the word "NOTE" rotated the way you want and then put that image into the table area reserved for a "dummy" variable (in example 1 below, my dummy variable is called BRKVAR). In #1 below, the name of this image file is 'c:\temp\note_sideways.jpg' -- the image was stored in the same location where my ODS statements wrote the output file.

2) use a simple text string -- with line feeds (using ODS ESCAPECHAR) between each character and, again, use a "dummy" variable (in my example 2, the dummy variable is called NOTEVAR). In this example, I am not sure that you can rotate each letter. I don't think there's a CSS style property for rotation. I know that there is no ODS style attribute for rotation.

So #1 gives you more control over the rotation, but it's an image. I showed only ODS HTML. If you wanted another destination you can experiment with ODS RTF or ODS PDF.

The SPANROWS option is needed so the cell for the "dummy" variable spans all the other rows in the table.

If this had been a graphical chart, the answer would have been to use the Annotate facility -- but that is not available for TABULAR reports.

cynthia
[pre]
data class;
set sashelp.class;
length notevar $40.;
brkvar='x';
notevar = "N ~n O ~n T ~n E";
run;

**1) Use Preimage;
ods listing close;
ods html file='c:\temp\note_sideways1.html' style=sasweb;
ods escapechar='~';

proc report data=class nowd spanrows;
title '1) Use Preimage';
column brkvar name age height sex weight;
define brkvar / order ' '
style(column)={background=white foreground=white
preimage='note_sideways.jpg' vjust=m};
define name/display;
define age /display;
define height/sum;
define sex/display;
define weight/display;
run;
ods html close;

** 2) Use Text and Line Feed with NOTEVAR and ODS ESCAPECHAR;
ods listing close;
ods html file='c:\temp\note2.html' style=sasweb;
ods escapechar='~';

proc report data=class nowd spanrows;
title '2) Use Letters, but cannot rotate them';
column notevar name age height sex weight;
define notevar / order ' '
style(column)={background=white foreground=black
font_face='Courier New' font_weight=bold
font_size=36pt
vjust=m};
define name/display;
define age /display;
define height/sum;
define sex/display;
define weight/display;
run;
ods html close;
[/pre]
Ask a Question
Discussion stats
  • 3 replies
  • 179 views
  • 0 likes
  • 2 in conversation