The SAS Output Delivery System and reporting techniques

How to drop values within one line in proc report

Accepted Solution Solved
Reply
Regular Contributor
Posts: 214
Accepted Solution

How to drop values within one line in proc report

[ Edited ]

Hi all,

 

Could you please help with the line of values dropping. I have the following output:

 

 

Thank you!


Accepted Solutions
Solution
‎02-05-2018 04:34 AM
Regular Contributor
Posts: 214

Re: How to drop values within one line in proc report

[ Edited ]
Posted in reply to DmytroYermak

Hi all, It seems that I mislead a little by my screenshots. The task was just to move the line down.

I did it putting "~n" before values in the corresponding lines. Sorry for the misleading.

View solution in original post


All Replies
Super User
Super User
Posts: 9,857

Re: How to drop values within one line in proc report

Posted in reply to DmytroYermak

Sorry really can't follow that.  Show some code and some test data (form of a datastep).  I mean does your dataset look like the output or are you doing across variables and such like.  Best practice from my point of view is to get the dataset to look exactly like the output should and avoid doing anything complicated in proc report.

Regular Contributor
Posts: 214

Re: How to drop values within one line in proc report

[ Edited ]

I bring my apologies for my English. I mean 'to make every line with 'no Severity' closer to the lines below in the group'. To receive the view of the template - second picture.

Super User
Super User
Posts: 9,857

Re: How to drop values within one line in proc report

Posted in reply to DmytroYermak

No need to apologise, your English is fine, its just the lack of code example to see how its being generated, as its not possible to say without seeing how your generating that.  As above, i always get my dataset looking exactly as I want the output to look, that way I don't need to do any across information, or summing, or much in the way of compute blocks to get the output as required.  

Regular Contributor
Posts: 214

Re: How to drop values within one line in proc report

[ Edited ]

Here below is the code. It seemed to me that one options existed like 'vjust' for proc report. But the question is how can it be applied just for every 5th line.



proc report data=T05_14_R nowd style(column)={asis=on} style(header)={asis=on font_weight=medium} split="*" ; by pgn PARAM; column pgn PARAMN var2 d SeverityN var3 - var12; define pgn / order order=internal noprint; define var2 / group "Visit/Timepoints" style(header)=[just=l cellwidth=14%] left; define PARAMN / order order=internal noprint; define SeverityN / order order=internal noprint; define var3 / "Severity" style(header)=[just=l cellwidth=8.5%] left; define var4 / " *Cohort 1/**(N=&N1)*n (%)" style(header)=[just=c cellwidth=8.5%] left; define var5 / " *Cohort 2/**(N=&N2)*n (%)" style(header)=[just=c cellwidth=8.5%] left; define var6 / " *Cohort 3/*(N=&N3)*n (%)" style(header)=[just=c cellwidth=8.5%] left; define var7 / " *Cohort 4/*(N=&N4)*n (%)" style(header)=[just=c cellwidth=8.5%] left; define var8 / " *Cohort 5/*(N=&N5)*n (%)" style(header)=[just=c cellwidth=8.5%] left; define var9 / " *Cohort 7/**(N=&N6)*n (%)" style(header)=[just=c cellwidth=8.5%] left; define var10 / " *Cohort 8/(N=&N7)*n (%)" style(header)=[just=c cellwidth=8.5%] left; define var11 / " *Cohort 9/*(N=&N8)*n (%)" style(header)=[just=c cellwidth=8.5%] left; define var12 / " *Cohort 10/(N=&N8)*n (%)" style(header)=[just=c cellwidth=8.5%] left; compute before PARAMN; line " "; endcomp; compute after pgn; line " "; endcomp; define d / ' ' style=[cellwidth=0.5%]; run;
Super User
Super User
Posts: 9,857

Re: How to drop values within one line in proc report

Posted in reply to DmytroYermak

Mmm, some oddities there.  I would suggest dropping a lot of it, and then adding bits back in one at a time.  For instance you have by pgn, param - but pgn is on the column row as well, and param never gets used?  Also, as pgn and paramn and severityn ar not printed I can't tell whats in those, so I would start from a blank simple report, then add these lines in one by one:

by pgn PARAM;

column   pgn PARAMN var2 d SeverityN var3 - var12;

define pgn / order order=internal noprint;
define var2 / group "Visit/Timepoints" style(header)=[just=l cellwidth=14%] left;
define PARAMN / order order=internal noprint;
define SeverityN / order order=internal noprint;
SAS Super FREQ
Posts: 9,434

Re: How to drop values within one line in proc report

Posted in reply to DmytroYermak

Hi:

  I would recommend you do this:

compute before PARAMN; 
   line "before PARAMN "; 
endcomp;

compute after pgn; 
   line "after PGN"; 
endcomp;

and then run your code to see which one of those LINE statements is causing the blank line. If that doesn't show you which COMPUTE block is responsible, then without data to test with, it is hard to make any other suggestions.

 

Cynthia

Regular Contributor
Posts: 214

Re: How to drop values within one line in proc report

[ Edited ]

 i always get my dataset looking exactly as I want the output to look

 

Do you mean that you divide one observation on several when a syllabification is needed?

Solution
‎02-05-2018 04:34 AM
Regular Contributor
Posts: 214

Re: How to drop values within one line in proc report

[ Edited ]
Posted in reply to DmytroYermak

Hi all, It seems that I mislead a little by my screenshots. The task was just to move the line down.

I did it putting "~n" before values in the corresponding lines. Sorry for the misleading.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 8 replies
  • 281 views
  • 0 likes
  • 3 in conversation