BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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?
4 REPLIES 4
Cynthia_sas
SAS Super FREQ
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
deleted_user
Not applicable
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.
Ksharp
Super User
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
Ksharp
Super User
[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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1208 views
  • 0 likes
  • 3 in conversation