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

Hi, All:

 

 

I am trying to create customed headers by using PROC REPORT.

I would like to delete un-needed blanks in front of headers

(for example, one blank that is in front of "BBBBB", which I do not expect).

 

 

They, Unexpected Blanks, emerge if using inline formatting to draw borderlines, I think.

They disappeared when not using inline formatting.

I have no idea. Please help me.

 

Thank you in advance.

data test;
    length column1-column3 $200.;
    column1="aaaaa"; column2="bbbbb"; column3="ccccc"; output;
run;
ods rtf file="PleaseSpecifyYourOwnFolder\test.rtf";
proc report data=test nowindows
    style(header)={backgroundcolor=white fontweight=light fontsize=8pt fontfamily="Times New Roman" asis=on}
    style(report)={rules=groups frame=void borderwidth=0.5pt bordercolor=black}
    ;
    column ("(*ESC*){style[fontfamily='Times New Roman' just=left]AAAAA}" column1 
        ("(*ESC*){style[borderbottomcolor=black borderbottomstyle=solid borderbottomwidth=0.5pt]BBBBB}" column2) 
        ("CCCCC" column3));
    define column1 / display;
    define column2 / display;
    define column3 / display;
run;
quit;
ods rtf close;

 ex.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

If you choose ASIS=OFF things appear to work.

https://go.documentation.sas.com/?docsetId=odsug&docsetTarget=p0xi2cygmfk0wkn1ei625zq5r488.htm&docse... 

 

It doesn't really explain why there are blanks in the first place and it looks to me like using (*ESC*) is adding a blank - but it makes things work at least.

 

You probably should also add brackets around your style definition for column1.

 

Below code works for me.

proc report data=test nowindows
    style(header)={backgroundcolor=white fontweight=light fontsize=8pt fontfamily="Times New Roman" asis=off}
    style(report)={rules=groups frame=void borderwidth=0.5pt bordercolor=black}
    ;
    column (
          ("(*ESC*){style[fontfamily='Times New Roman' just=left]AAAAA}" column1)
          ("(*ESC*){style[borderbottomcolor=black borderbottomstyle=solid borderbottomwidth=0.5pt ]BBBBB}" column2) 
          ("CCCCC" column3)
          );
    define column1 / display;
    define column2 / display;
    define column3 / display;
run;

 

View solution in original post

3 REPLIES 3
Patrick
Opal | Level 21

If you choose ASIS=OFF things appear to work.

https://go.documentation.sas.com/?docsetId=odsug&docsetTarget=p0xi2cygmfk0wkn1ei625zq5r488.htm&docse... 

 

It doesn't really explain why there are blanks in the first place and it looks to me like using (*ESC*) is adding a blank - but it makes things work at least.

 

You probably should also add brackets around your style definition for column1.

 

Below code works for me.

proc report data=test nowindows
    style(header)={backgroundcolor=white fontweight=light fontsize=8pt fontfamily="Times New Roman" asis=off}
    style(report)={rules=groups frame=void borderwidth=0.5pt bordercolor=black}
    ;
    column (
          ("(*ESC*){style[fontfamily='Times New Roman' just=left]AAAAA}" column1)
          ("(*ESC*){style[borderbottomcolor=black borderbottomstyle=solid borderbottomwidth=0.5pt ]BBBBB}" column2) 
          ("CCCCC" column3)
          );
    define column1 / display;
    define column2 / display;
    define column3 / display;
run;

 

KentaMURANAKA
Pyrite | Level 9

Hi, Patrick-san:

 

 

Sorry for my late response.

Yes, I think so, there may be problem of (*ESC*).

I replaced (*ESC*) with escapechar="^", and resolved.

 

 

Thanks a lot for your help!

KentaMURANAKA
Pyrite | Level 9

Hi, Patrick-san, All:

 

 

There may be difference of in-line formatting between style[xxxxx] and S={xxxxx}.

Using style[xxxxx], results have un-needed blanks, and using S={xxxxx}, have no un-needed blanks.

For your information.

 

Thanks!!

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
  • 3 replies
  • 1369 views
  • 2 likes
  • 2 in conversation