DATA Step, Macro, Functions and more

PROC REPORT

Reply
Contributor
Posts: 50

PROC REPORT

[ Edited ]

Hi,

i am not getting the last column , the tot_forecast

proc report data = Olympics2 headline;
column _probability___ (n) Total_Media_Value Tot_Forecast ;
where _probability___ > 0;
define _probability___/group Descending 'Probability';
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 = (Total_Media_Value.sum*_probability___)/100;
endcomp;
rbreak after / summarize ol ul skip;
run;

 there is an error: Missing values are generated  as a result of performing an operation on a each place 

 

Super User
Posts: 7,854

Re: PROC REPORT

I edited the post for you, so that the code is easier to read. PLEASE use the "little running man" icon to open the subwindow for SAS code.

 

Please also post the complete log of the proc report step, so one can see where the missings have effect.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 11,343

Re: PROC REPORT

This may also be data related. Without data it is very hard to test code.

 

This link shows how to create data step code that you can post as text or attach as a text file so that we can recreate data: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... to use with your code.

Super User
Posts: 10,044

Re: PROC REPORT

You can make a condition before computing it.

if not missing(Total_Media_Value.sum) and not missing(_probability___) then 
Tot_Forecast = (Total_Media_Value.sum*_probability___)/100;

Ask a Question
Discussion stats
  • 3 replies
  • 243 views
  • 0 likes
  • 4 in conversation