Iam stuck in how do i make use of the TABULATE as I need to generate the breakdown of the revenues for both week 1 & 2 and also for both laptop models sold ( AT3600 and AP3965 ) .Since i have been given that the price of the laptop AT3600 and AP3965 are $ 1,99.99 and $ 299.99 respectively for the week 1 ( 01/11/2009 - 01/11/2009 ) and , whereas , the price of the model AT3600 is still $ 1,99.99 but for the model AT3600 it rises to $ 4,99.99 for the model AP3965 in the week 2.
secondly , the problem is complicated in that the owner of the company follows the policy that Laptops purchased before 3pm will be shipped that day but those purchased after 3pm will be shipped the following day and he wants to find the proprtion of the tarnsactions that qualify for the same day delivery.A sample of the datatable is below :
With this latest post, what SAS programming logic *HAVE* you attempted that did not work, possibly? You will get the most benefit by asking for guidance with some self-initiative rather than asking from someone else to do the programming for you.
So, here you go:
1) consider the INTNX function (or YEAR and WEEK functions) to derive a week-of variable, and if you go with INTNX to assign a SAS WEEK_START_DATE variable, apply a SAS FORMAT for a suitable date value in your code somewhere.
2a) the time-constant for 3:00PM is "15:00:00"T -- so if you want to assign a SHIPS_TODAY variable, say a value of 1 or 0 (so you can do summary analysis), or....
2b) consider combining you "date" and "time" variables together using the DHMS function to create a SAS numeric DATETIME variable, allowing you to increment and decrement the date-portion and/or move forward/backward the time or date portion using the INTNX function, when needed -- I am only suggesting this because you make mention about shipping dates and transaction dates/times.
3) recommend you start with "basic" SAS procedures and so you may consider MEANS or SUMMARY (and PRINT), rather than TABULATE.
So, with this guidance, I encourage you strongly to go digest the SAS documentatoin in each of these areas, develop a "logic flow" diagram on paper/whatever, then begin pecking away at SAS programming elements needed to get the desired report output, or otherwise.
And, when you feel you have made progress and then have a specific challenge, come back to the forum, with a new post, properly titled, and share your SAS log output with a problem/challenge you might have. We don't need to see your raw data ever time - just a data-sample (suitable for the post) is all that's needed.
And, again, the SAS eLearn web site will be your friend for the coming days, weeks, months. Also there are SAS learning books you can purchase, readily available to help you learn the fundamentals about the SAS system and programming it out-the-wazoo!