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.
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".
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:
Cynthia
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)
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.