Question : You have been working as a data analysts in HadoopExam Inc. recently you have moved from Python programming to SAS programming, and start using Do looping of SAS. Which of the following statement is correct with regards to Do loop?
A. You can use conditions in the Do loop. B. It will always generate one observations. C. It can be used in both DATA and PROC steps D. It can be used read data as well as producing multiple observation using output statement.
Yes, you can use condition in do loop to control iteration, when to exit from loop. No it is not generate only single observation. It can generated multiple observations, for that you can use output statement, so that each generated observation can be written otherwise it will write last observation in output. Do loop can only be used in DATA step and cannot be used with the PROC step. Yes, do loop read dataset.
Question : You have been given below SAS program
data course100; Fee=5000; FEE_HIKE=0.1;
do month=1 to 12; put _all_; TOTALFEE+(FEE+TOTALFEE)*FEE_HIKE; end; run;
Correct Answer : Get Lastest Questions and Answer : Explanation: Its very simple question, you need to understand do loop. As simple do loop will have start and end index. Here, end index is 12, which says this loop will be executed 12 times.
Question : Which function calculates the average of the variables Var1, Var2, Var3, and Var4? 1. mean(var1,var4) 2. mean(var1-var4) 3. Access Mostly Uused Products by 50000+ Subscribers 4. mean(of var1-var4) Ans : 4 Exp : Use a variable list to specify a range of variables as the function argument. When specifying a variable list, be sure to precede the list with the word OF. If you omit the word OF, the function argument might not be interpreted as expected.
Question : You have been given below program
data course100 ; Fee=5000; FEE_HIKE=0.1;
XXXXX put _all_; INCREASE+(FEE+INCREASE)*FEE_HIKE; iteration+1; output; end; run;
Replace XXXXX values with the DO statement, so that code under which will be executed 20 times?
Correct Answer : Get Lastest Questions and Answer : Explanation: As we need to focus on iteration using do loop. Given question is asking it should be done 20 times. There are two ways by which you can thing of 20 times iteration either increment from 1 to 20 or decrement from 20 to 1. As given option has 20 as start value, so we need to decrease its value in each iteration which can be done using by statement with value as -1. Hence, correct value is option 1
1. The SUM statement produces only a grand total of NUMBER. 2. The SUM statement produces only subtotals of NUMBER for each value of TYPE. 3. The SUM statement produces both a grand total of NUMBER and subtotals of NUMBER for each value of TYPE. 4. Nothing is produced by the SUM statement; the program fails to execute.