Select Page

UCLA Combining SAS Data Sets Creating and Maintaining Permanent Formats Coding Task

Question Description

Using SAS, to get three files for the whole assignment.

one program file, one output file, and one log file for the entire assignment.

three questions

see the file for more information.

1. Handling Same-Named Variables and Different Data Types for BY Variables

The data set orion.web_products2 contains an observation for every product available
for sale on Orion Star’s wholesale website.

Partial orion.web_products2 (20 Total Observations)

Product_ID Price Name

120400304333 114.36 Smasher Super Rq Ti 350 Tennis Racket

120400305288 53.26 Knife

120400305846 107.74 Big Guy Men’s Air Deschutz Viii Shoes

120400308766 40.96 Big Guy Men’s Packable Hiking Shorts

120400308849 12.23 Wood Box for 6 Balls

The data set orion.web_orders2 contains a list of orders made in a single day from the
website. Each observation contains the product ID, the quantity ordered, and the customer’s
name.

Partial orion.web_orders2 (43 Total Observations)

Product_ID Quantity Name

120400305288 16 Carglar Aydemir

120400305288 19 Sanelisiwe Collier

120400305846 13 Candy Kinsey

120400305846 13 Cynthia Martinez

120400305846 10 Rolf Robak

? The two data sets are sorted by Product_ID. Product_ID is a numeric variable in orion.web_products2 and a character variable with a length of 12 in orion.web_orders2.

a. Create a new data set, web_converted, from the orion.web_products2 data set. Change the type of Product_ID to character. (Use the data set web_converted to merge with orion.web_orders2 in the next step.)

Hint: Use the RENAME= data set option to change Product_ID to some other name, such as nProduct_ID, the LENGTH statement to declare a new character variable named Product_ID, and an assignment statement with a PUT function to explicitly convert the numeric value in nProduct_ID into a character value in Product_ID.

b. Create three new data sets:

A data set named revenue contains the product code, the price, the quantity sold, the product name, the customer name and the revenue generated from each sale. Revenue is calculated as Price*Quantity.

? The Name variable in web_converted refers to the product name and the Name variable in web_orders2 refers to the customer name. Give each variable an appropriate name in the revenue data set.

A data set named notsold contains the product code, price, and product name for each product that was not sold.

A data set named invalidcode contains the product code, quantity, and customer name for each observation in the web_orders2 data set that does not have a corresponding product code in the web_products2 data set.

c. Print the three data sets with appropriate titles. The data sets should contain 39, 7, and 4 observations, respectively. (The data sets you create might have different variable names
than the ones shown here.)

Partial work.revenue (39 Observations)

"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you "A" results."

Order Solution Now