Insert Title



-236220-838835Week 1 Assignment Instructions: Getting Familiar With SAS? Log in to SAS?.Press F4 to create a new SAS? program. (The program you create will automatically be given a name similar to Program 1, Program 2, etc.) Be sure the CODE tab is selected. Your screen should look similar to the one below.You first need to get the data for your business scenario into SAS?. For this first assignment, you will use the DATALINES statement in conjunction with an INPUT statement to read data that you will enter directly in the program in a future step in this assignment (rather than reading data stored in an external file, an approach you will experiment with later in this course). Don’t worry if you don’t understand all of the code just yet.Copy and paste the following data into the CODE window, beginning on Line 1:DATA bakerydata;LENGTH State $17 City $14; INFILE DATALINES DELIMITER=',';INPUT State $City $YearRevenue;DATALINES;Note that the DATA statement shown above names the data table (bakerydata) and explains the format of the data that you will eventually type under the DATALINES statement.In addition, note that the dollar sign identifies data that is character data, as opposed to numeric data. SAS? truncates character data to 8 characters, so you will use the LENGTH statement to tell SAS? the longest length in any character column. The code above says that the State column can contain 17 characters and the City column can contain 14 characters.Next, open the Week 1 Assignment Data file in Notepad or Textpad (or some other text editor) and copy and paste the data without the column headers on a new line after the DATAFILES line. To signify the end of the data, type a semicolon on the next line at the end of the data, which is line 260.To ensure the data is properly formatted, place a PROC PRINT; (including the semicolon) on line 262 as shown below, followed by a RUN; statement.PROC PRINT DATA=bakerydata;RUN;To run the program, click the running man icon in the bar above the code. Alternatively, you can press shortcut key F3 to run the code.If there are no errors, SAS? will take you to the RESULTS tab and display the results of the code. Your results window should look similar to the one shown below. Note that the records are numbered sequentially and ordered alphabetically by state (the same way the data was entered in the code). Also notice that the figures in the Revenue column are not formatted with dollar signs. You will learn how to format dollar amounts later in this course.Click the CODE tab to return to the code window. In this step you will change the SAS? programming code to enable you to answer the questions that the CEO has asked.In the code window, beneath the existing code, copy and paste the following code beginning on line 266. This purpose of this code is to group the data by state and sum the revenue of the business.PROC SQL ;TITLE 'Bakery Sales By State';SELECT State, SUM(Revenue) AS TotalRevenue FROM bakerydataGROUP BY StateORDER BY TotalRevenue descending;QUIT;After you have finished copying and pasting the code, click the run icon (the icon beneath the CODE tab that looks like a running man). Alternatively, you can press F3 to run the code. After you run the code, a results window similar to the one below appears. It should look the same as it did the last time (because you kept the original code). But if you scroll down inside the results window, you should see an additional page displaying the results of running the new code: a new table titled “Bakery Sales By State” that shows only the states and their associated four-year revenues, organized by the most revenue.Create a Microsoft? Word document named LastName_FirstName_Week1Questions.docx. In the document, type your answers to the following three questions based on your program output:In which states has the Good For You! Bakery sold the most product over the last four years?In which states has the company sold the least product from 2013 - 2017?What recommendation regarding marketing and distribution, if any, would you make to the CEO based on this analysis?What recommendation regarding marketing and distribution, if any, would you make to the CEO based on this analysis?Save your SAS? program by following the steps below:In SAS?, click the Save program icon that appears beneath the CODE and LOG tabs. In the Save As dialog box that appears, scroll to the Name field and type LastName_FirstName_Week1Program.sas. (For example, if your name is Jane Doe, you would type Doe_Jane_Week1Program.sas).Still in SAS?, in the Location field click Files (Home).Still in SAS?, click the Save button.Still in SAS?, right-click your newly saved file and, from the pop-up menu that appears, save your .sas file somewhere on your computer where you can find it again. ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download