Help using Base SAS procedures

Proc Report Question

Posts: 1

Proc Report Question

I am currently working on a project in which I am looking at three different types of patients. For two of the patient types, there is a count variable, a Bed to RN variable, and an AVS to ED Departure Variable. The third patient type has the Count and Bed to RN variables, but instead of the AVS to ED Departure variable, it has an IP Bed Ready variable. Since I am reporting by type, this leaves three blank columns in my report. I can't do a noprint option because it will get rid of the variable across the board, not just for the patient type. Is there a way I can do a conditional noprint option? I have attached my code so hopefully it makes sense.

Super User
Posts: 10,508

Re: Proc Report Question

What do you want your output to look like? That will probably get better responses.

Super User
Posts: 5,085

Re: Proc Report Question

I'm not sure if there's a difficult solution or not, but there's certainly an easy one.  Why not just run PROC REPORT twice?  Use a different WHERE statement to select the TYPE(s), and change the final column appropriately.

Good luck.

Posts: 8,743

Re: Proc Report Question


  I'm having a hard time visualizing your data from just seeing your code. There is not anything like a conditional NOPRINT with PROC REPORT. However, when you are in an ACROSS scenario, PROC REPORT tries to help you out by "completing" all the categories under an ACROSS item. Sometimes, this is what you want; sometimes not. I would recommend that you try to turn off the automatic completion of columns by using NOCOMPLETECOLS statment in your PROC REPORT code:

proc report data=xxx.yyy nowd nocompletecols;

...more code...


  If that doesn't work for you, then you might want to open a track with Tech Support. Running PROC REPORT twice is one option; there might also be a way to manipulate your data so that you have some kind of better type indicator variable for each of your columns and then you have a simple COUNTVAR for each type indicator variable. At any rate, Tech Support can look at all of your data and all of your code and help you come to the best solution.


Ask a Question
Discussion stats
  • 3 replies
  • 4 in conversation