BookmarkSubscribeRSS Feed
Maddy4u
Calcite | Level 5

Hi All,

 

I am currently starter in using the SAS Proc report procedure, Could you please look in the below note and help me out on what exactly it issue is:

 

My data:

 

data sample:

  input flightid $ Expenses;

   datalines;

  IA03400 89155

;

run;

 

My proc report code is as below:

 

proc report data=sample.expenses nowd;
  column flightid expenses abh;
  define abh / computed ;
   compute abh;
    abh=expenses*100;
   endcomp;
run;

 

With the above code I am having a note in the log as "Variable expenses is uninitialized."

Is this something that we cannot refer the variable which is already existing in the dataset for compute.

 

Thank you

1 REPLY 1
BrunoMueller
SAS Super FREQ

Have a look at the doc for proc report, specifically Four Ways to Reference Report Items in a Compute Block. Since EXPENSES is a numeric variable, its default usage is ANALYSIS with statistic SUM, so you need write it like

data sample;
  input flightid $ Expenses;
  datalines;
IA03400 89155
;
run;

proc report data=sample nowd;
  column flightid expenses abh;
  define abh / computed;

  compute abh;
    abh = expenses.sum * 100;
  endcomp;
run;

Bruno

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 645 views
  • 0 likes
  • 2 in conversation