BookmarkSubscribeRSS Feed
Prateek1
Obsidian | Level 7

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 

 

3 REPLIES 3
Kurt_Bremser
Super User

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.

ballardw
Super User

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.

Ksharp
Super User
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;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1510 views
  • 0 likes
  • 4 in conversation