Help using Base SAS procedures

PROC REPORT

Reply
Occasional Contributor VS
Occasional Contributor
Posts: 15

PROC REPORT

Hi, I had PROC REPORT with a few calculated vars in COMPUTE BEFORE block, but they displayed between data and row headings.

Then I changed to COMPUTE BEFORE _PAGE_. Now it displays where intended but the calculated values do not display.

What am I missing?  (I've attached a file with a code excerpt and results).

Thanks you in anticipation..


Question.PNG
Super Contributor
Posts: 490

Re: PROC REPORT

this is the normal behavior of COMPUTE BEFORE and COMPUTE BEFORE _PAGE_

You can set the options "noheader" to the PROC REPORT statement and use the COMPUTE BEFORE

then you can list the column names by yourself in the line statement.

  COMPUTE BEFORE ;

  line 'Number of LL2@ flags: ' f2.sum;

     ...

  line @1 'column one name' @20 'column two  name' ... ;

  line @1 5*'=';

  line ' ';

  endcomp;

Super User
Posts: 10,023

Re: PROC REPORT

It seems you can get those value before PAGE break , add out=xxxx  option in proc report to see if it has already gotten the value.

Or you could try COMPUTE AFTER _PAGE_

SAS Super FREQ
Posts: 8,864

Re: PROC REPORT

Hi:

  There is really not enough information from your posted program to really give you constructive help. The usage of the (other variables) GROUP? ORDER? Do you really want the SUM of the date variables? So without ALL the code and some data to test, anyone who might want to help, has to factor in the time to guess about what you did not show, make guesses about the data and guess about what your (other variables) are. And, I see you're doing BY group processing too. Then, they have to make the data AND write the program.

  It should be fairly easy for you to use SASHELP.PRDSALE or one of the other SASHELP datasets to mock up a sample program that illustrates your issue when it is run. That way, people don't have to guess about the (other variables) or the data. There is a date variable in the SASHELP.PRDSALE dataset. You only need 1 date variable and 1 other numeric variable (you could use quarter) for your COMPUTE block in a sample program. Or you could make a small data set from your real data of just 2 by groups with only a few obs in each by group.

cynthia

Ask a Question
Discussion stats
  • 3 replies
  • 234 views
  • 6 likes
  • 4 in conversation