BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi Friends,

I tried to write the dataset observation to PDF. But the PDF file has large line spacing between the two observations. Please help me how to reduce the line space.
And also i want to write some datas in bold (particular obsertion). Is it possible to use BOLD options in Put statement. please help me.

Thanks,
Selvi.
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
You may not need to use the DATA step for what you want to accomplish. It is very easy in PROC REPORT to highlight a whole row conditionally.

Consider the example code at the bottom. If you run the program, you will see that the output has every row where the age is 12 highlighted. In addition, I changed the font of the output to Courier New and removed the interior lines and borders (since that was something you wanted to do in a previous post.)

Perhaps this is something that might be an alternative to DATA _NULL_.
cynthia
[pre]
*** the code;
options center leftmargin=1in rightmargin=1in topmargin=1in bottommargin=1in;
ods listing close;
ods pdf file='c:\temp\bold_row.pdf';
ods escapechar='~';

title f="Courier New" bold 'My Title in Courier';
proc report data=sashelp.class nowd
style(report)={rules=none frame=void
cellspacing=0 cellpadding=2}
style(header)={font_face="Courier New"
font_size=12pt
background=white}
style(column)={font_face="Courier New" font_size=10pt};
column name age height;
define name / order;
define age / display;
define height/display;
compute age;
if age = 12 then
call define (_ROW_,'style',
'style={font_weight=bold font_face="Courier New"}');
endcomp;
run;
ods pdf close;[/pre]

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1 reply
  • 3691 views
  • 0 likes
  • 2 in conversation