BookmarkSubscribeRSS Feed
Guofeng
Fluorite | Level 6

I'd like to indent some words when generate html files. For instance, there is column aecat as below shows:

 

data abc;

 set a;

 if aedecod ='' then aecat=aesoc;
 else  aecat="(*ESC*){unicode 007C}"||strip(aedecod);

run;

 

ods html file='xxxx/a.html';

proc report data=abc nowd;

column aecat;

define aecat/display;

run;

ods html close;

However, the unicode doesn't work.  Could anybody help me? Thank you.

 

4 REPLIES 4
Kurt_Bremser
Super User

Try this:

data abc;
set a;
if aedecod = ''
then aecat = aesoc;
else aecat = "  " || strip(aedecod);
run;

ods html file='xxxx/a.html';

proc report data=abc nowd;
column aecat;
define aecat/display style(column)={asis=on};
run;

ods html close;

Idea taken from https://communities.sas.com/t5/ODS-and-Base-Reporting/Preserve-Leading-Blanks-in-ODS-Output/td-p/193..., which is the first hit of a google search (Maxim 6) for "leading blanks in proc report".

Cynthia_sas
SAS Super FREQ

Hi:

  This previous posting showed one technique for RTF and PDF:

https://communities.sas.com/t5/SAS-Programming/Proc-report-help/td-p/327126

 

 The only difference is that for HTML, you need to use INDENT= instead of LEFTMARGIN=, as shown below:

html_indent.png

 

Cynthia

Guofeng
Fluorite | Level 6
Hi Cynthia, Thank you so much for your detail explain. It's so wonderful~ This is the best way to intent word if previous group like Region is just used for group (no need to summary by region).
Guofeng
Fluorite | Level 6

Hi KurtBremser, thank you for your advice. Yes, it can indent by this way. However, the outcome appearance is not good: there are unnecessary frame for the indent words.(already highlighted as yellow)

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1082 views
  • 0 likes
  • 3 in conversation