BookmarkSubscribeRSS Feed
Prateek1
Obsidian | Level 7

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 .

??

 

2 REPLIES 2
ballardw
Super User

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.

Cynthia_sas
SAS Super FREQ

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

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2 replies
  • 789 views
  • 0 likes
  • 3 in conversation