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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 935 views
  • 0 likes
  • 4 in conversation