Date: Wed, 26 Jul 2006 09:32:56 -0700
Reply-To: Cheryl <cheryl.warrick@VERIZON.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Cheryl <cheryl.warrick@VERIZON.COM>
Organization: http://groups.google.com
Subject: Help! Proc Report Error when trying to create a computed variable
Content-Type: text/plain; charset="iso-8859-1"
I'm trying to get a simple computed variable AVGARPU (this is average
revenue), which is calculated as ARPU divided by CNT. I want to use
proc report because of the nice feature of using the across variable
combined with calculated fields. I would rather not revert to proc
summary or proc transpose as my solution. However, I have tried many
variations of the code below... changing the order the of the variables
and such and nothing seems to work.
The code and msg from the sas log are below. thanks for any help.
Cheryl.
***
I get the following message when I run the code that follows. The
variables ARPU and CNT are NEVER missing on the input dataset.
MPRINT(RPT): proc report data=proj.samp_triples headline headskip
missing;
MPRINT(RPT): column play data_code data video_code video voice_code
voice ob, (avgarpu cnt=cnt2) cnt arpu ;
MPRINT(RPT): define play /group ;
MPRINT(RPT): define data_code /group ;
MPRINT(RPT): define data /group ;
MPRINT(RPT): define video_code /group ;
MPRINT(RPT): define video /group ;
MPRINT(RPT): define voice_code /group ;
MPRINT(RPT): define voice /group ;
MPRINT(RPT): define ob /across;
MPRINT(RPT): define cnt /noprint;
MPRINT(RPT): define arpu /noprint;
MPRINT(RPT): define avgarpu /computed ;
MPRINT(RPT): define cnt2 /sum;
MPRINT(RPT): compute avgarpu;
MPRINT(RPT): avgarpu = arpu / cnt;
MPRINT(RPT): endcomp;
MPRINT(RPT): break after play / summarize;
MPRINT(RPT): break after data / summarize;
MPRINT(RPT): rbreak after / summarize dol dul;
MPRINT(RPT): title 'Report1';
MPRINT(RPT): run;
NOTE: Variable cnt is uninitialized.
NOTE: Variable arpu is uninitialized.
NOTE: Division by zero detected at line 1 column 17.
NOTE: Division by zero detected at line 1 column 17.