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;

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