BookmarkSubscribeRSS Feed
kaet78ha
Calcite | Level 5

The is a proc report with a #BYVAL statement header:

 

ods listing close;
ods &outype file="%sysfunc(pathname(out))\&outname2..&outype" style=acrsstyle &bookmk;
run;


proc report data=tab split='~' missing nowd style={bordertopcolor=black bordertopwidth=1};
column pgcnt COHORT SITEID SUBJECT DATE AGE_C SEX RACE_C ETHNIC WGTLB_C HGTINCH_C CBP FST PROT ;

define pgcnt / order order=internal noprint;
define COHORT / order order=data noprint;
define SITEID / order order=internal 'Site' style(column)=[width=10% just=left asis=on font_face=&fontf font_size=&fontsz ] ;
define SUBJECT / order order=internal 'Subject' style(column)=[width=11% just=left asis=on font_face=&fontf font_size=&fontsz ] ;
define DATE / 'Date of Birth' style(column)=[width=7% just=left asis=on font_face=&fontf font_size=&fontsz ] ;
define AGE_C / 'Age~(Years)' style(column)=[width=5% just=left asis=on font_face=&fontf font_size=&fontsz ] ;
define SEX / 'Gender' style(column)=[width=5% just=left asis=on font_face=&fontf font_size=&fontsz ] ;
define RACE_C / 'Race' style(column)=[cellwidth=8% just=left asis=on font_face=&fontf font_size=&fontsz ] flow ;
define ETHNIC / 'Ethnicity' style(column)={width=7.5% just=left font_face=&fontf font_size=&fontsz};
define WGTLB_C / 'Weight~(kg)' style(column)={width=6% just=left font_face=&fontf font_size=&fontsz};
define HGTINCH_C / 'Height~(cm)' style(column)={width=6% just=left font_face=&fontf font_size=&fontsz};
define CBP / "Childbearing~Potential?" style(column)={width=9% just=left font_face=&fontf font_size=&fontsz};
define FST / "FST~Score" style(column)={width=8% just=left font_face=&fontf font_size=&fontsz};
define PROT / "Protocol~Version" style(column)={width=15% just=left font_face=&fontf font_size=&fontsz};

break after pgcnt / page;

compute before SUBJECT ;
line '' ;
endcomp;
by COHORT;
TITLE8 justify=left 'Treatment: #BYVAL(COHORT)';
endcomp;

run;

ods &outype close;
ods listing;

The space between headline and "Treatment: #byvar" header should be removed, I've tried few things but it doesn't work: 

kaet78ha_1-1625563239427.png

 

 

2 REPLIES 2
himself
Pyrite | Level 9
Just a thought, probably you need to strip,the variable cohort before it being used in the proc report.
Cynthia_sas
SAS Super FREQ
Hi: I can't tell if you're talking about the space after the "Treatment:" or the space under the Title line and before the border line.

However, if there's a workaround it will most likely be dependent on the destination. You've closed the LISTING destination, but are using a macro variable to specify destination and don't show what the value of that macro variable is. Your output could be RTF, PDF or HTML output. And, you're using a custom Style template.

Your best resource for this question might be Tech Support, because they will need to look at your data, your code, your style template and understand the value of your macro variable for destination in order to help you.
Cynthia

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 563 views
  • 0 likes
  • 3 in conversation