DATA Step, Macro, Functions and more

Computed Variable "Not in the Report Definition" in Proc Report

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 119
Accepted Solution

Computed Variable "Not in the Report Definition" in Proc Report

Hi,

 

For some reason my computed variable AveResponse is not showing up in my output. The log also shows a warning message stating that "AveResponse Not in the Report Definition". Q1-Q5 are quizzes with a score that ranges from 1 to 5. I am looking to display the average response for each ID of the 5 quizzes.

 

Everything looks ok as far as I can see. Anyone else have any ideas? Thanks.

-----------------------------

Libname Learn '/folders/myfolders/Learn' ;

Title "Report on the Survey Data Set" ;
Title2 ;
Title3 ;

proc report data=learn.survey nowd headline ls=80 ;
    columns Subj Gender Age Income Q1-Q5 ;
    define Subj      / display  "ID" width=5 ;
    define Gender    / display  width=5 ;
    define Age       / display  width=5 ;
    define Income    / display "Salary" width=5 format=dollar10. ;
    define Q1        / display  noprint ;
    define Q2        / display  noprint ;
    define Q3        / display  noprint ;
    define Q4        / display  noprint ;
    define Q5        / display  noprint ;
    Compute AveResponse ;
        AveResponse = mean of(Q1-Q5) ;
    EndComp ;
     define AveResponse / computed "Average Response" width=8 format=3.1 ;
run ;


Accepted Solutions
Solution
‎01-17-2018 10:59 AM
Super Contributor
Posts: 500

Re: Computed Variable "Not in the Report Definition" in Proc Report

Posted in reply to ManitobaMoose

Adding AveResponse to the columns statement should fix the issue.

View solution in original post


All Replies
Solution
‎01-17-2018 10:59 AM
Super Contributor
Posts: 500

Re: Computed Variable "Not in the Report Definition" in Proc Report

Posted in reply to ManitobaMoose

Adding AveResponse to the columns statement should fix the issue.

Frequent Contributor
Posts: 119

Re: Computed Variable "Not in the Report Definition" in Proc Report

Posted in reply to andreas_lds

Great! I just overlooked that.... Thanks!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 134 views
  • 1 like
  • 2 in conversation