BookmarkSubscribeRSS Feed
VS
Calcite | Level 5 VS
Calcite | Level 5

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
3 REPLIES 3
mohamed_zaki
Barite | Level 11

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;

Ksharp
Super User

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_

Cynthia_sas
SAS Super FREQ

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 918 views
  • 6 likes
  • 4 in conversation