Help using Base SAS procedures

Proc report note clarification

Reply
Frequent Learner
Posts: 1

Proc report note clarification

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

SAS Super FREQ
Posts: 708

Re: Proc report note clarification

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

Ask a Question
Discussion stats
  • 1 reply
  • 183 views
  • 0 likes
  • 2 in conversation