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

Hello!

I am trying to put horizontal lines between subject identifiers in a RTF output and the following comes close:

compute before subjid / style={bordertopcolor=black bordertopwidth=3};

     line '';

endcomp;

However, I want a solution that does not create an extra blank line inserted as this creates too much white space.  Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  Without seeing all your code or the style that you are using, it is hard to guess what the rest of your code looks like. But do you want something like the cyan-colored lines in the attached screenshot?

  If so, instead of doing a COMPUTE before, try just using a COMPUTE for SUBJID with a CALL DEFINE statement to change the _ROW_ style attributes, as shown in the test code below.

cynthia

ods listing close;
options center orientation=portrait nodate nonumber
        topmargin=1in bottommargin=1in
        rightmargin=1in leftmargin=1in;

data test;
  set sashelp.class;
  subjid=catt(sex,age);
run;
title; footnote;
   
ods rtf file='c:\temp\bordertest.rtf' style=journal;
proc report data=test nowd;
  column subjid name height weight;
  define subjid / group ;
  define name / order;
  define height / sum;
  define weight / sum;
  compute subjid ;
       if subjid gt ' ' then
       call define(_row_,'style',
                  'style={bordertopcolor=cyan bordertopwidth=3}');
  endcomp;
run;
ods rtf close;


border_test.png

View solution in original post

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

Hi:

  Without seeing all your code or the style that you are using, it is hard to guess what the rest of your code looks like. But do you want something like the cyan-colored lines in the attached screenshot?

  If so, instead of doing a COMPUTE before, try just using a COMPUTE for SUBJID with a CALL DEFINE statement to change the _ROW_ style attributes, as shown in the test code below.

cynthia

ods listing close;
options center orientation=portrait nodate nonumber
        topmargin=1in bottommargin=1in
        rightmargin=1in leftmargin=1in;

data test;
  set sashelp.class;
  subjid=catt(sex,age);
run;
title; footnote;
   
ods rtf file='c:\temp\bordertest.rtf' style=journal;
proc report data=test nowd;
  column subjid name height weight;
  define subjid / group ;
  define name / order;
  define height / sum;
  define weight / sum;
  compute subjid ;
       if subjid gt ' ' then
       call define(_row_,'style',
                  'style={bordertopcolor=cyan bordertopwidth=3}');
  endcomp;
run;
ods rtf close;


border_test.png
asumsie
Obsidian | Level 7

Great, thanks Cynthia.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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