Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Assignment #9 | STAT674

1. (20 pts) This question builds on Q1 of assignment M10.  Goal is still to use PROC CONTENTS to show the variables of each of the 6 datasets : cumstoers, items, list, orders, prices, and salesrep, by extracting the ODS table that contains the description of variables like below.

1.1 This time, use a macro with appropriate parameters, and call the macro 6 times to create the results.

1.2 (bonus question, 5 pts) In the macro you created in Q1.1, add some steps to append the result data tables to a base dataset. In the lectures there were examples of appending dynamic datasets.

2. (20 pts) Create a macro and call it to find the following. Allow enough flexibility through parameters so that it can be called to answer both 2.1 and 2.2.

2.1 Find out the earliest published book in these datasets. Follow the logic in the part of ‘data driven programming’ to avoid hard coding. DO NOT use %let to assign macro variables. If more than one published in the same year, assume the lower ISBN refers to an earlier publication.

2.2 Call the macro again, to find out the latest published book in these datasets.

3. (15 pts) Create a macro and call it to find the following. Allow enough flexibility through parameters so that it can be called to answer all questions in 3.1, 3.2 and 3.3.  Be sure not to use hard coding.  Do NOT use %let to assign macro variables.

3.1 Use data driven programming to figure out which book is the best seller among the available datasets.  At the end, print that result and copy it here.

3.2 Call the macro to figure out which book is the 2nd best seller.

3.3 Call the macro to figure out which book sold the least over the years.

4. (15 pts) Let’s help the manager again, by creating a macro to help her to find out performance of sales rep in a given year. Do not hard code.  As a final report, show the rep’s name, his/her total sales of the year, and the date and day you created your report.  Again, do not hard code.

4.1 Call the macro to find out the best sales rep in 2008.

4.2 Call the macro to find out the worst sales rep in 2009.

5. (30 pts) Let’s look at the book prices again.  The dataset prices logged the price changes of each book over time. Create a macro that will find the number of price changes per book.

5.1  Call the macro to find out which book has changed prices the most times. At the end, Print the information of that book (year, author(s), title, ISBN) and copy your result here.

5.2 Call the macro to find out which book(s) had exactly 15 price changes over the years.  This is a slightly different task from Q5.1, and you may need to use macro control logic.