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

I want the output text like below.

"This is an example this is an example this is an example this is an example  this is an example this is an

         example this is an example this is an example this is an example 

This is an example this is an example this is an example this is an example  this is an example this is an

         example this is an example this is an example this is an example "

This is opposite to the "indent" like

proc report data=try;

    column x;

    define x / style={indent=0.3in};

run;

unfortunately, I forgot the keyword. Someone can help me out? Thanks a lot. 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
data a;
length x $1000;
do i=1 to 5;
 x=repeat("This is an example ", 6);
 x=catx(' ',x,'~n~_~_~_~_~_~_~_',repeat("This is an example ", 14));
output;
end;
run;

ods escapechar='~';
ods rtf file="c:\temp\temp.rtf" ;
proc report data=a nowd missing;
define x/style(column)={asis=on};
run;
ods rtf close;

 

 

Or try this one :

 

 

 

data a;
length x $1000;
do i=1 to 5;
 x=repeat("This is an example ", 8);
 x=catx(' ',x,'~n~{unicode 09}',repeat("This is an example ", 12));
output;
end;
run;

ods escapechar='~';
ods rtf file="c:\temp\temp.rtf" ;
proc report data=a nowd missing;
run;
ods rtf close;

View solution in original post

4 REPLIES 4
Ksharp
Super User
Can you post your sample data ?
Niugg2010
Obsidian | Level 7

For example below

data a;
length x $1000;
do i=1 to 5;
x=repeat("This is an example ", 20);
output;
end;
run;
ods rtf file=".... ....\try1.rtf";
proc report data=a;
column x;
define x/style={indent=0.3in};
run;
ods rtf close;

 

The above code produced below figure 1, but I want figure 2. Currently I combined "^R'\li1000\fi-1000'" with data to get figure 2, which makes the data hard to read. I remember SAS has a simple way as I did with "indent" above . Thanks

 

 Figure 1

Capture.jpg

 

Figure 2

Capture2.JPG

Ksharp
Super User
data a;
length x $1000;
do i=1 to 5;
 x=repeat("This is an example ", 6);
 x=catx(' ',x,'~n~_~_~_~_~_~_~_',repeat("This is an example ", 14));
output;
end;
run;

ods escapechar='~';
ods rtf file="c:\temp\temp.rtf" ;
proc report data=a nowd missing;
define x/style(column)={asis=on};
run;
ods rtf close;

 

 

Or try this one :

 

 

 

data a;
length x $1000;
do i=1 to 5;
 x=repeat("This is an example ", 8);
 x=catx(' ',x,'~n~{unicode 09}',repeat("This is an example ", 12));
output;
end;
run;

ods escapechar='~';
ods rtf file="c:\temp\temp.rtf" ;
proc report data=a nowd missing;
run;
ods rtf close;
Niugg2010
Obsidian | Level 7

Ksharp, Thanks for your help. 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 681 views
  • 0 likes
  • 2 in conversation