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

Hi SAS users,

 

I have a table (table have) with the code. I want to modify it to "table want" (black line under the first line, footnote line change, no vertical line in the middle). 

 

How should I modify the code that I have? Thank you.

 

table havetable havetable wanttable want

 

PROC REPORT DATA=ALL      LIST     MISSING     NOWINDOWS
            HEADLINE      HEADSKIP SPLIT = '@' ;
   WHERE NUM GE 4 ;
COLUMN (NUM SORT1 VARNM COL1 )   ;

DEFINE NUM    /ORDER NOPRINT  ;
DEFINE SORT1    /ORDER NOPRINT ;
DEFINE VARNM  /ORDER WIDTH=20 'Parameter' LEFT
                 style(column)=[cellwidth=2.00in font_weight=bold ] ;
DEFINE COL1  /WIDTH=12 "Data" CENTER
                 style(column)=[cellwidth=2.50 in] ;

   compute before NUM ;
      count+1;
   endcomp;
   compute NUM;
      if NUM ^= '' and count ^=1 then call define(_row_,'style','style=[bordertopcolor=black bordertopwidth=2]');
   endcomp;

BREAK AFTER NUM / SKIP ;

 compute after _page_/ style={just=left};
    line "n, number; SD, standard deviation; Min, minimum; Max, maximum.";
  endcomp;


RUN;

 

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  Changing STYLE(HEADER) on the PROC REPORT statement, as shown below, worked for me. You did not explain about what ODS destination you wanted. I switched to JOURNAL style for the RTF, but left the HTMLBLUE style for HTML, since you did not clarify what destination you wanted.

 

  I also cleaned up your code to get rid of the LISTING only options and also simplified your IF statement for the CALL DEFINE statement.

 

Cynthia

 

style_header_journal.png

View solution in original post

4 REPLIES 4
Cynthia_sas
SAS Super FREQ

Hi:

  You don't show your ODS statements. I don't understand what style you used to get the dotted lines as cell dividers in either of your screenshots. Also, you didn't post any data for WORK.ALL, so no one can run your code.

 

  Your code is also inconsistent -- you use LISTING only options (HEADLINE, HEADSKIP, SKIP, WIDTH ) that would be ignored by ODS destinations and you include style overrides designed for ODS destinations without showing the destination code you used for either screen shot.

 

  Without data, you are asking people to not only make some fake data, but to guess about what destination you want.

 

Cynthia

superbibi
Obsidian | Level 7

Thank you for the response. I just attached the dataset here.

Cynthia_sas
SAS Super FREQ

Hi:

  Changing STYLE(HEADER) on the PROC REPORT statement, as shown below, worked for me. You did not explain about what ODS destination you wanted. I switched to JOURNAL style for the RTF, but left the HTMLBLUE style for HTML, since you did not clarify what destination you wanted.

 

  I also cleaned up your code to get rid of the LISTING only options and also simplified your IF statement for the CALL DEFINE statement.

 

Cynthia

 

style_header_journal.png

superbibi
Obsidian | Level 7
Thank you very much!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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