I want to change the line (_____________) under the heading of the table to dotted line (---------) under the heading of the table in proc report step. I tried using options formchar still its not working for me.
Are you using formchar with the listing destination? I never tried it, but I doubt if it has any effect outside that destination.
Please post your code, both the Proc Report and how you set the Formchar.
And if you are sending this to any other ODS destination other than Listing it will not be used.
From the documentation of proc report and the Formchar option:
Restriction This option affects only the LISTING output. It has no affect on other ODS output.
@Jannet - Just add your code to this post using the insert SAS code icon (the running man).
proc template;
%** Courier 9pt **;
define style Styles.ods_9pt;
parent=styles.rtf;
replace fonts/
'TitleFont2' = ("Courier New",9pt,Bold )
'TitleFont' = ("Courier New",9pt,Bold )
'FootnoteFont' = ("Courier New",9pt )
'StrongFont' = ("Courier New",9pt )
'EmphasisFont' = ("Courier New",9pt )
'FixedEmphasisFont' = ("Courier New",9pt )
'FixedStrongFont' = ("Courier New",9pt)
'FixedHeadingFont' = ("Courier New",9pt, Bold)
'BatchFixedFont' = ("Courier New",9pt,Bold )
'FixedFont' = ("Courier New",9pt )
'headingEmphasisFont' = ("Courier New",9pt,Bold )
'headingFont' = ("Courier New",9pt,Bold )
'docFont' = ("Courier New",9pt );
replace document from container /
asis = on
protectspecialchars=off;
replace SystemFooter from TitlesAndFooters /
asis = on
protectspecialchars = on
font= Fonts('FootnoteFont');
replace systemtitle from titlesandfooters/
asis = on
protectspecialchars=off;
replace body from document /
asis = on;
replace color_list
"Colors used in the default style" /
'link'= blue
'bgH'= white
'fg' = black
'bg' = white;
replace Table from output /
Background=_UNDEF_
cellpadding = 0pt
Rules=groups
Frame=void;
style Header from Header /
Background=_undef_;
style Rowheader from Rowheader /
Background=_undef_;
replace pageno from titlesandfooters/
Foreground=white;
end;
ods listing;
options papersize='LETTER' orientation=landscape topmargin = '3.61cm' bottommargin = '3.61cm'
leftmargin = '2.54cm' rightmargin = '2.54cm' nodate nonumber missing=.;
ods rtf file="/home/u000000/sasuser.v94/Listings/listing_Demo.rtf" style=styles.ods_9pt nogtitle nogfootnote;
ods escapechar = '~';
options formchar='|_---|+|---+=|-/\<>*'
options validvarname=any;
options pageno=1;
proc report data=newb nowd headline headskip split='*';
column num mypage TRT01A SITE BRTHDTC AGE SEX ETHNIC HEIGHTBL WEIGHTBL;
define num/ noprint;
*break after num/skip;
define mypage /order noprint;
break after mypage / page;
define TRT01A/'Treatment' order descending center style(column)={width=1in};
define SITE/'Site Id.*Unique Subject Id.' center style(column)={width=1in};
define BRTHDTC/'Date of*Birth' center style(column)={width=1in};
define AGE/'Age (YEARS)*[1]' center style(column)={width=1in};
define SEX/'Sex' center style(column)={width=1in};
define ETHNIC/'Ethnicity' center style(column)={width=1in};
define HEIGHTBL/'Height*(cm)' center style(column)={width=1in};
define WEIGHTBL/'Weight*(kg)'center style(column)={width=1in};
*compute after TRT01A;
*line '';
*endcomp;
title1 j=l height=10pt font="Courier New" "Protocol: XXX" ;
title3 j=l height=10pt font="Courier New" "Population :XXX" j=r 'Page ^{thispage} of ^{lastpage}';
title4;
title5 j=c height=10pt font="Courier New" "Listing";
title6 j=c height=10pt font="Courier New" "Listing of Demographic Characteristics";
title7;
footnote1 j = l height=10pt font="Courier New" "20NOV2020 10:42";
run;
ods rtf close;
ods listing;
There is no way to test the code without data that matches your data set.
Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the </> icon or attached as text to show exactly what you have and that we can test code against.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.