The SAS Output Delivery System and reporting techniques

SAS ODS PDF (Displaying single observation in multiple rows in report)

Reply
N/A
Posts: 0

SAS ODS PDF (Displaying single observation in multiple rows in report)

Hi

I am creating a sas ods pdf report using proc report. What i need to show is display one observation in two (or three) rows(s). In the final report i want to display few variables in top row , few variables in the second and then few in third row (and this completes one sas data observation, repeat the same for all the obsevations). This i need to do for the whole data. The report template is fixed always and the variables are also shown at the fixed place. How to do the same?
SAS Super FREQ
Posts: 8,743

Re: SAS ODS PDF (Displaying single observation in multiple rows in report)

Hi:
PROC REPORT (and most of the SAS reporting procedures) create tabular output in which every row on the report has the same number of columns. So, normally, for SASHELP.CLASS, you would not have NAME and SEX on row 1, HEIGHT and WEIGHT on row 2 and AGE on row 3 of a report, for example.

You said that "The report template is fixed always and the variables are also shown at the fixed place." Is the report already being created in the desired form? And, if so, how?

cynthia
N/A
Posts: 0

Re: SAS ODS PDF (Displaying single observation in multiple rows in report)

I have a template generated from Microsoft Access which i need to replicate through SAS. In that fixed template i have lets say 10 variables in a dataset. 6 variables should come in one row, 2 in second and then rest 2 in third. This will be done for the subsequent observations then. I tried using split command in proc report but it dint help me much.
Super User
Posts: 9,681

Re: SAS ODS PDF (Displaying single observation in multiple rows in report)

Hi.
I try to use proc report's line statement to get what you want.
But I do not know it is whether you exactly needed.
proc report's line statement is very powerful and useful.


[pre]
ods pdf file='c:\test.pdf' style=sasweb;
proc report data=sashelp.class nowd ;
column name sex age weight height;
define name /order noprint;
define sex /order noprint;
define age /order noprint;
define weight /order noprint;
define height/order noprint;
compute before height;
line @8 name $10. @20 sex $1. @25 age 2.;
line @10 weight 5.2 @20 height 5.2;
endcomp;
run;
ods pdf close;
[/pre]



Ksharp
Super User
Posts: 9,681

Re: SAS ODS PDF (Displaying single observation in multiple rows in report)

[pre]
ods pdf file='c:\test.pdf' ;
proc report data=sashelp.class nowd style(report)={rules=none frame=void outputwidth=50%} ;
column name sex age weight height;
define name /order noprint;
define sex /order noprint;
define age /order noprint;
define weight /order noprint;
define height/order noprint;
compute before height;
line @8 name $10. @20 sex $1. @25 age 2.;
line @10 weight 5.2 @20 height 5.2;
endcomp;
run;
ods pdf close;
[/pre]



Ksharp
Ask a Question
Discussion stats
  • 4 replies
  • 349 views
  • 0 likes
  • 3 in conversation