| Date: | Thu, 4 Mar 2010 10:00:45 -0800 |
| Reply-To: | mark <mark.chase91@YAHOO.IN> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | mark <mark.chase91@YAHOO.IN> |
| Organization: | http://groups.google.com |
| Subject: | Re: PROC TABULATE |
|
| Content-Type: | text/plain; charset=ISO-8859-1 |
On Mar 4, 9:39 pm, jim.1s...@YAHOO.COM (Jim Groeneveld) wrote:
> Hi Mark,
>
> It ain't easy, is it?
> Confusing that DATA in the data and proc steps, just different!
>
> Remove:
>
> >Data Tabulate;
> >set sales;
>
> and change the PROC TABULATE statement to:
> proc tabulate data=WEEK f=dollar8.;
>
> Regards - Jim.
> --
> Jim Groeneveld, Netherlands
> Statistician, SAS consultanthttp://jim.groeneveld.eu.tf
>
> On Thu, 4 Mar 2010 07:19:55 -0800, mark <mark.chas...@YAHOO.IN> wrote:
> >Hello All ,
>
> >I'm using PROC TABULATE. I have pasted some sample data below as I
> >have nearly 400+ observations.
>
> > Transaction Timeof
> >Laptop Units
> > Obs ID DateofSale Sale
> >Model Sold Warranty Week
>
> > 256 RX000476 23/11/2009 09:40:09 AP3965
> >1 0 Week4
> > 257 RX000475 23/11/2009 23:28:37 AP3965
> >1 0 Week4
> > 258 RX000474 23/11/2009 06:50:40 AP3965
> >1 0 Week4
> > 259 RX000473 23/11/2009 09:47:16 AP3965
> >1 0 Week4
> > 260 RX000472 23/11/2009 05:35:33 AP3965
> >1 0 Week4
> > 261 RX000471 23/11/2009 14:26:35 AT3600
> >1 0 Week4
> > 262 RX000470 23/11/2009 07:33:28 AT3600
> >1 0 Week4
>
> >Objective is - To find the # UnitsSold of each kind of LaptopModel -
> >AP3965 & AT3600 for every week. The data is monthly so I've 4 weeks.
>
> >The code I used :-
>
> >data week;
> >set sales;
> > IF DateofSale >= "01/11/2009" and DateofSale < "08/11/2009" THEN
> > Week = "Week1";
> > Else IF DateofSale >= "08/11/2009" and DateofSale < "15/11/2009" THEN
> > Week = "Week2";
> > Else IF DateofSale >= "15/11/2009" and DateofSale < "22/11/2009"
> >THEN
> > Week = "Week3";
> > ELSE IF DateofSale >= "22/11/2009" and DateofSale < "29/11/2009"
> >THEN
> > Week = "Week4";
> >Proc Print data = week;
> >Run;
>
> >Data Tabulate;
> >set sales;
> >proc tabulate data=tables f=dollar8.;
> > class week Laptopmodel;
> > var UnitsSold;
> > table week*Laptopmodel,
> > Unitssold*Mean=" ";
> >run;
> >proc print data = Tabulate;
> >run;
>
> >The log -
>
> >522 proc tabulate data=tables f=dollar8.;
> >ERROR: File WORK.TABLES.DATA does not exist.
> >523 class week Laptopmodel;
> >ERROR: No data set open to look up variables.
> >ERROR: No data set open to look up variables.
> >524 var UnitsSold;
> >ERROR: No data set open to look up variables.
> >525 table week*Laptopmodel,
> >526 Unitssold*Mean=" ";
> >527 run;
>
> >NOTE: The SAS System stopped processing this step because of errors.
>
> >Kindly suggest what chnage do I need in the 2nd code
>
> >Kind Regards ,
> >Mark
Hello ,
Is it possible to do Conditional Sum over two columns, say I wnat to
find no. of units sold over each of the 4 weeks.
regards ,
mark
|