May 22, 2010

SAS Project 1: Retailing Industry....SAS Technical Problem to solve....DIY

Here’s a simple SAS Problem to work with…
This was presented at a technical interview screening at Gap Inc….
For the following 7 questions we are working with a temporary database called PRODUCT Each record is a product transaction along with the following information:
Store$1Store number 0-9
Product$20Product Number
Datemmddyy10.Date of the transaction
Buy_sell$1‘B’ if the product was Bought or ‘S’ if it was sold
Units12.# of units transacted
Price12.2Unit price
Please answer the following questions using this database:
  1. Assume that the data is loaded into memory as WORK.PRODUCT, write a program that lists by Store, the following information: Store; products bought; total cost per product. Create a table called work.totalbuy.
  2. We have just been told that there is an error in the data. There can only be products sold after a product has been bought for any one store. Clean the data and output any errors to work.errors.
  3. Write a macro that for each store would create a file work.STOREx (where x = the store number). The file should have data that summarizes information across products.
  4. Use Proc Freq to determine what products are being bought across all stores. Store this information in work.prodbuy.
  5. Do number 4 again without using Proc Freq but using a different procedure.
  6. Do number 4 again using the data step and not the procedure used in 4 and 5.
  7. Using WORK.PRODUCT output a dataset that contains the a record for the each store with the earliest purchase date for each product; the earliest sale date for each product; and the total profit for each product.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.