Hi Everyone,
I have below data and I have used Proc report to create a RTF output I am trying to insert vertical border lines between columns but because I am using "compute before" statement the vertical lines get cut, I am expecting a straight line from up till down . Could anyone please help me with this ? (I have tried to put a blank row in data and then pass it in proc report that works but I am looking for more simple solution.)
My data:
code:
Proc report data= class Headline Headskip NOWD split='|' missing;
column Name Sex Age Height Weight;
define name / Order "Name" style(header)=Header{just=left asis=on borderleftcolor=black borderleftwidth=1}
style(column)={just=left cellwidth=1.3in borderleftcolor=black borderleftwidth=1 };
define sex / "Sex" flow style(header)=Header{ just=center} style(column)={cellwidth=0.6in just=center borderleftcolor=black borderleftwidth=1};
define age / "Age" style(header)=Header{just=center} style(column)={cellwidth=0.6in just=center borderleftcolor=black borderleftwidth=1} ;
define height / "Height" flow style(header)=Header{just=center} style(column)={cellwidth=0.6in just=center borderleftcolor=black borderleftwidth=1};
define weight / "Weight" flow style(header)=Header{just=center} style(column)={cellwidth=0.6in just=center borderleftcolor=black borderleftwidth=1};
compute before name;
line " ";
endcomp;
run;
Output:
Expected Output:
Regards,
Shweta
Instead of computing a line before each record, I would just add a BREAK BEFORE statement and a "white color" for the font :
Proc report data= sashelp.class Headline Headskip NOWD split='|' missing;
column Name Sex Age Height Weight;
define name / Order "Name" style(header)=Header{just=left asis=on borderleftcolor=black borderleftwidth=1}
style(column)={just=left cellwidth=1.3in borderleftcolor=black borderleftwidth=1 };
define sex / "Sex" flow style(header)=Header{ just=center} style(column)={cellwidth=0.6in just=center borderleftcolor=black borderleftwidth=1};
define age / "Age" style(header)=Header{just=center} style(column)={cellwidth=0.6in just=center borderleftcolor=black borderleftwidth=1} ;
define height / "Height" flow style(header)=Header{just=center} style(column)={cellwidth=0.6in just=center borderleftcolor=black borderleftwidth=1};
define weight / "Weight" flow style(header)=Header{just=center} style(column)={cellwidth=0.6in just=center borderleftcolor=black borderleftwidth=1};
break before name / summarize style={color=white};
run;
Best,
Instead of computing a line before each record, I would just add a BREAK BEFORE statement and a "white color" for the font :
Proc report data= sashelp.class Headline Headskip NOWD split='|' missing;
column Name Sex Age Height Weight;
define name / Order "Name" style(header)=Header{just=left asis=on borderleftcolor=black borderleftwidth=1}
style(column)={just=left cellwidth=1.3in borderleftcolor=black borderleftwidth=1 };
define sex / "Sex" flow style(header)=Header{ just=center} style(column)={cellwidth=0.6in just=center borderleftcolor=black borderleftwidth=1};
define age / "Age" style(header)=Header{just=center} style(column)={cellwidth=0.6in just=center borderleftcolor=black borderleftwidth=1} ;
define height / "Height" flow style(header)=Header{just=center} style(column)={cellwidth=0.6in just=center borderleftcolor=black borderleftwidth=1};
define weight / "Weight" flow style(header)=Header{just=center} style(column)={cellwidth=0.6in just=center borderleftcolor=black borderleftwidth=1};
break before name / summarize style={color=white};
run;
Best,
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.