Help using Base SAS procedures

proc tabulate(code used)

Reply
N/A
Posts: 0

proc tabulate(code used)

Hi,

In the problem that i asked in last post , I used the code -

proc tabulate data=Week OUT=WEEKOUT;
class Product;
VAR REVENUE ;
TABLE Week
*Product all
,
n='Total_Units_Purchased'*f=comma9.
pctn
Revenue*mean*f=dollar9.0
;
run;

Kindest regards,
Mark
SAS Super FREQ
Posts: 8,861

Re: proc tabulate(code used)

Posted in reply to deleted_user
Hi:
Thank you for posting your code. However, let's get this code in the same vicinity as the data you just posted:
DATA:
[pre]
product Units_Purchased REVENUE
1 1 699.99
1 2 699.99
1 1 699.99
1 1 699.99
2 2 699.99
2 1 699.99
2 2 699.99
[/pre]

CODE you said you tried:
[pre]
proc tabulate data=Week OUT=WEEKOUT;
class Product;
VAR REVENUE ;
TABLE Week*Product all,
n='Total_Units_Purchased'*f=comma9.
pctn Revenue*mean*f=dollar9.0;
run;
[/pre]

What is interesting to note is that the code you posted shows the use of a variable called WEEK, although your data does NOT show the WEEK variable -and- your code does not list the WEEK variable in a CLASS or VAR statement.

Thus, I would expect that you are experiencing this same error:
ERROR: The type of name (Week) is unknown.
as you showed in this previous forum posting:
http://support.sas.com/forums/thread.jspa?messageID=39693鬍 (on July 15) and which someone already posted a response to.

And, as Scott pointed out, we have seen some of your questions with this data before:
http://support.sas.com/forums/message.jspa?messageID=32184
http://support.sas.com/forums/thread.jspa?messageID=32298
http://support.sas.com/forums/thread.jspa?messageID=33111
http://support.sas.com/forums/thread.jspa?messageID=33390

Where does the WEEK variable come from??? The data you posted really won't work in the TABULATE code you posted without the WEEK variable. Perhaps the code you posted isn't the code you used for the PRODUCT, REVENUE and UNITS_PURCHASED data???

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