DATA Step, Macro, Functions and more

summarize values are not generated after proc report

Reply
Contributor
Posts: 50

summarize values are not generated after proc report

hi,

 

 I have created  a summary report by Proc Report which should have following columns

Probability, Nbr_of_Optys, Total_Media_Value & Tot_Forecast which is computed by the product of probability & Total_Media_Value.

I have written this Syntex.

 

proc report data = Work.Olympicscs1 headline;
column Probability Stage (n) Tot_Budget Tot_Forecast;
where Probability > 0;
define Probability/group Descending 'Probability';
define Stage/group noprint;
define n / format = comma6. 'Nbr_of_Optys';
define Total_Media_Value/analysis format = dollar25. 'Tot_Budget';
define Tot_Forecast/computed format = dollar25.;
compute Tot_Forecast;
Tot_Forecast = (Tot_Budget.sum*Probability)/100;
endcomp;

rbreak after/summarize ol ul skip;

run;

i am not getting the summarized values are not generated after rbreak for computed variable while running proc report in base sas .

??

 

Super User
Posts: 11,343

Re: summarize values are not generated after proc report

Please provide example data in the form of a data step. This link will show how to create a data step from you dataset.

https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...

 

Also it often helps to show the log of the code submitted.

SAS Super FREQ
Posts: 8,864

Re: summarize values are not generated after proc report

Hi:

  Is this related to either of your previous posts?

https://communities.sas.com/t5/Base-SAS-Programming/proc-report/m-p/286895#M58939
https://communities.sas.com/t5/Base-SAS-Programming/PROC-Report/m-p/286843

 

It is very helpful for you to post data with EVERY question instead of making someone go back and find your previous posts or figure out from the 3 different code examples you've posted, which data this new code example goes with.

 

  It seems odd to me that you are using a group variable, Probability in an assignment statement. It is possible. But odd. Is your code entirely correct? I would have expected to see Stage,(n) not Stage (n) in the COLUMN statement. Other possibly incorrect things is that you have the variable Tot_Budget on the COLUMN statement, but you have Total_Media_Value in the DEFINE statement and then you refer to Tot_budget.sum in the assignment statement. In the COMPUTE block you need to refer to the item names in the COLUMN statement or to temporary variables. You do NOT refer to variable labels. Also, before you worry about the RBREAK not working or how to make it work, I'd recommend fixing the other problems in the code. I would expect there to be some warnings or errors in the SAS Log.

 

  Also not sure about the OL UL SKIP -- those are ignored by all ODS destinations. So unless you are going to plain LISTING, I would not expect those to work.

 

cynthia

Ask a Question
Discussion stats
  • 2 replies
  • 192 views
  • 0 likes
  • 3 in conversation