Help using Base SAS procedures

proc report

Reply
Super Contributor
Posts: 272

proc report

I need to add a line after a group variable. The following code works. The line appears after all groups of observations. But I need it have only after first group of observations. How to write a code.Thanks.

 

compute after grp/style={protectspecialchars=off};
line '\brdrt\brdrs ';
endcomp;

Super User
Posts: 10,041

Re: proc report

Posted in reply to knveraraju91

This kind of question should be posted at another forum ODS and Base Reporting  Cynthia is there .

 

Here is an example:

 

proc report data=sashelp.class nowd;
column age weight;
define age/group;
define weight/display;
compute after age/style(lines)={backgroundcolor=yellow};
n+1;
len=ifn(n=1,20,0);
dummy=' ';
line dummy $varying20. len;
endcomp;
run;
Super Contributor
Posts: 272

Re: proc report

Thanks for your answer. It is worked. But it results in a wide line with yellow background. I need to keep normal  line. Can you please modify the code. Thanks

Super User
Posts: 10,041

Re: proc report

Posted in reply to knveraraju91

??

Remove

/style(lines)={backgroundcolor=yellow};
Super Contributor
Posts: 272

Re: proc report

I am sorry that I am asking you again. I need a line ___________________________________________ like this. How to get this line after first group of observations. Thanks.

Super User
Posts: 19,851

Re: proc report

Posted in reply to knveraraju91

Just a guess, but try combining your original code and @Ksharp code. Basically keep the n, which counts the number of groups and then add an if to your line statement. 

 

 

Super User
Posts: 10,041

Re: proc report

[ Edited ]
Posted in reply to knveraraju91

OK.

 

 

dummy='\brdrt\brdrs ';

 

 

And don't forget :

 

compute after grp/style={protectspecialchars=off};

 

 

Updated

Super Contributor
Posts: 272

Re: proc report

Thank you all. It worked.

Ask a Question
Discussion stats
  • 7 replies
  • 426 views
  • 0 likes
  • 3 in conversation