Question: You were asked to review the following code: PROC SQL; SELECT MEDICATION, PETID, COST, COST * . 0 7 5 AS TOTAL _ COST FORMAT

You were asked to review the following code:
PROC SQL;
SELECT MEDICATION, PETID, COST, COST *.075 AS
TOTAL_COST FORMAT DOLLAR10.2,
CASE
WHEN TOTAL_COST <50 THEN 'Low Cost Med'
WHEN TOTAL_COST <100 THEN 'Average Cost Med'
WHEN TOTAL_COST <200 THEN 'High Cost Med'
WHEN TOTAL_COST >=200 THEN 'Extremely High Cost Med'
ELSE 'No Cost Med or Unknown Med Cost'
END AS MED_COST_CATEGORY
FROM WORK.PETMEDS;
Based on what has been provided, what is your assessment of this code?
Question 6 options:
A)
The code is correct as written and will run properly
B)
There is an error in the Case expression so the code will not run properly
C)
There is an error because there should not be a comma before the Case expression begins
D)
The query creates a new field named TOTAL_COST
E)
If the value of TOTAL_COST is 0, the results of the query will be "No Cost Med or Unknown Med Cost"
F)
A & C are correct

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!