Correct Answer : Get Lastest Questions and Answer : Explanation: There are multiple ways by which you can reference all the variables in do loop. Once is by getting its size using dim function. Next normal do loop start with index 1 and end with last index in this case 4. As well as you can use do i=1,2,3,4 all the indexes of array.
Question : You have similar variables in your dataset like sales of last months jan, feb, mar, apr, may, jun. And you wanted to do some calculations on those variable referencing them through array, which of the following statement is correct with regards to array?
A. All newly created variable through array will be added in compilation stage of data step B. Only numeric variables can be created through array declaration C. Only character variables can be created through array declaration. D. It is not mandatory to define all the variables explicitly while array declaration.
Correct Answer : Get Lastest Questions and Answer : Explanation: You can create variables through array declaration of any of the either character or numeric type.
Yes, array variables are created during compilation phase only. It is not mandatory to declare array variables which are used in your data, you can use _Numeric_ or _character_ to refer all the numeric or character variables from the dataset.
Question : You have been given below data set and program
data course100 (drop=index); set course101; array existing{99:100} fee DURATION; array new_values{99:100} nfee nduration;
do index=99 to 100; put _all_; new_values{index}=existing{index}+existing{index}*.10; end; run;
What is the value of nduration variable for course_id=104
Correct Answer : Get Lastest Questions and Answer : Explanation: It seems a big program, but the question is asking what value will be assigned for a variable nduration for 4th observation. As each ndirection value is 10 % additional of existing duration value. So the final answer will be 88.