BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SASuserlot
Barite | Level 11

I am trying to print the observation that is character length bigger than 200. I tried the following but it won't print  because its cutoff  in dataset itself. I want to achieve it using compute block but its not aligning with other columns. For example in the example, name got cutoff when I use it as observation , if I use in compute block its not aligning with sex and age. How can I achieve having full name and align with other columns. I am aware of I can spit the length using escape character to avoid getting into other column. Any help really appreciated. Thanks.

SASuserlot_0-1636059916107.png

 

data class ;
length name $200;
set sashelp.class;
x=_n_;
if x=1;
if name= 'Alfred' then name=" this is very long variable length bigger than the 200 character how to print this in the proc report , I am having difficulty to achieve it, Can you please help. I really appreciate your help may be I missing something here  or forgot how to achieve it";
run;


title ' ';
footnote '';
options orientation = landscape errors = 2 missing = ' ' nofmterr ls = 175 validvarname = upcase nofmterr nobyline;

ods escapechar = '^';
ods results on; 
ods listing close; 
ods rtf file = "&tmplocation.\xx.rtf" style = table_rtf; 

proc report data = class ls = 145 ps = 55  split = "?" headline center missing formchar(2) = '_';
	** titles **;

	** report **;
	column  ("^R/RTF'\brdrb\brdrs '" name  sex age);
	define name     / group order = internal style(header) = [just=l] style(column) = [just=l vjust=b cellwidth=35.0% asis=on] "name "                                               ;
	define age    / group order = internal style(header) = [just=l] style(column) = [just=l vjust=b cellwidth= 5.0% asis=on] "age"                                              ;
	define sex    / group order = internal                          style(column) = [just=c vjust=b cellwidth= 8.6% asis=on] "sex"                                      ;

	compute before name;
/*		line @1 'this is very long variable length bigger than the 200 character how to print this in the proc report , I am having difficulty to achieve it, Can you please help. I really appreciate your help may be I missing something here  or forgot how to achieve it';*/
	endcomp;

run;
ods rtf close;

 

SASuserlot_1-1636059974770.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
Isn't the limitation because NAME has a length of 200? If you increase that in your first portion does it work?

length name $200;

View solution in original post

2 REPLIES 2
Reeza
Super User
Isn't the limitation because NAME has a length of 200? If you increase that in your first portion does it work?

length name $200;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1609 views
  • 2 likes
  • 2 in conversation