Why is the answer 8 instead of 3 observations? Shouldn't it be 3 since there are 3 A's?
conditional explicit ouput= 3
unconditional explicit output=5
Total= 8
HTH
That's a trick. You read too fast and didn't see the *2* output statements.
/* Think of the code as follows */
data WORK.ONE WORK.TWO;
set WORK.INPUT;
if Var1='A' then output WORK.ONE;
output /* to both WORK.ONE and WORK.TWO */;
run;
1) create the data set(s).
data work.input; input var1 $ var2 $; datalines; A one A two B three C four A five ; run;
for example.
2) run the code.
3) examine the results.
4) figure out which bit you missed along the way to the answer.
You'll learn a lot that way.
Depending on the source of these questions there may also be typos in the answer keys.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.