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
Diamond | Level 26

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)

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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