20.8k views
3 votes
Which of the following programs correctly reads data set and creates the fastorder data set?

a.
data fastorder(drop=Ordertime);
set (keep=Product Units Price);
if Ordertime<4;
Total=Units*Price;
run;
b.
data orders(drop=Ordertime);
set july.fastorder(keep=Product Units Price);
if Ordertime<4;
Total=Units*Price;
run;
c.
data fastorder(drop=Ordertime);
set (keep=Product Units Price Ordertime);
if Ordertime<4;
Total=Units*Price;
run;

User Zkurtz
by
7.7k points

1 Answer

3 votes

Final answer:

The correct program for reading the 'fastorder' data set and applying certain conditions is option 'c', which includes all necessary variables and correctly uses the if statement to filter and calculate the Total.

Step-by-step explanation:

The question is asking which program correctly reads a data set named fastorder and creates a new data set while applying certain conditions and variable manipulations. The correct answer is option 'c'. Let's break down why:

In option 'a', the program attempts to drop the variable Ordertime before it reads the data set, which is incorrect because it will not have the Ordertime variable available to evaluate in the if statement.

Option 'b' incorrectly refers to a data set july.fastorder, which is not mentioned as the source data set in the question. It also tries to drop the Ordertime variable, which is needed for the if statement.

Option 'c' correctly includes the Ordertime variable in the keep statement and successfully applies the condition if Ordertime<4 before calculating the Total, which is the product of Units and Price.

User Futbolpal
by
8.4k points