Premium

Base SAS Certified Associate: Programming Fundamentals Using SAS Questions and Answers (Dumps and Practice Questions)



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.

 : You have been working as a data analysts in HadoopExam Inc. recently you have moved from Python programming to SAS programming, and start
1. A,B
2. B,C
3. Access Mostly Uused Products by 50000+ Subscribers
4. A,D
5. B,D

Correct Answer : Get Lastest Questions and Answer :
Explanation: Lets take one by one given option.

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;

How many time do loop will be iterated?

 : You have been given below SAS program
1. 0

2. 1

3. Access Mostly Uused Products by 50000+ Subscribers

4. 11


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?

  :
1. do month=20 to 1 by -1;

2. do month=20 to 1 by 1;

3. Access Mostly Uused Products by 50000+ Subscribers

4. do month++=20 to 1 by -1;


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


Related Questions


Question :The following SAS program is submitted:

data work.sets;
do until (prod gt 6);
prod + 1;
end;
run;

What is the value of the variable PROD in the output data set?

 :The following SAS program is submitted:
1. 6
2. 7
3. 8
4. . (missing numeric)


Question :The SAS data sets WORK.EMPLOYEE and WORK.SALARY are shown below:
WORK.EMPLOYEE WORK.SALARY
fname age name salary
Bruce 30 Bruce 25000
Dan 40 Bruce 35000
Dan 25000
The following SAS program is submitted:
data work.empdata;
by fname;
totsal + salary;
run;
Which one of the following statements completes the merge of the two data sets by the FNAME variable?
 :The SAS data sets WORK.EMPLOYEE and WORK.SALARY are shown below:
1. merge work.employee
work.salary (fname = name);
2. merge work.employee
work.salary (name = fname);
3. merge work.employee
work.salary (rename = (fname = name));
4. merge work.employee
work.salary (rename = (name = fname));


Question :
The SAS data set PETS is sorted by the variables TYPE and BREED.
The following SAS program is submitted:
proc print data = pets;
var type breed;
sum number;
run;
What is the result?

 :
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.



Question : The following SAS program is submitted:
data work.passengers;
if OrigPassengers = then
OrigPassengers = 100;
TransPassengers = 100;
OrigPassengers =
TotalPassengers = sum (OrigPassengers, TransPassengers) +0;
run;
What is the value of the TOTALPASSENGERS variable in the output data set?
 : The following SAS program is submitted:
1. 0
2. 100
3. 200
4. (missing numeric value)


Question :
Given the SAS data set PRICES:
PRICES
Prodid priceproducttypesalesreturns
K1255.10NETWORK152
B132S 2.34HARDWARE30010
R18KY2 1.29SOFTWARE255
3KL8BY 6.37HARDWARE12515
DY65DW 5.60HARDWARE455
DGTY23 4.55HARDWARE672
The following SAS program is submitted:
data hware inter cheap;
set prices(keep = productype price);
if producttype = `HARDWARE' then output hware; else if producttype = `NETWORK' then output
inter; if price le 5.00;
run;
if producttype = `HARDWARE' then output hware; else if producttype = `NETWORK' then output
inter; if price le 5.00;
run;
How many observations does the HWARE data set contain?

 :
1. 0
2. 2
3. 3
4. 4


Question : The following SAS program is submitted:
How many observations are written to the WORK.SALES data set?
 : The following SAS program is submitted:
1. 0
2. 1
3. 5
4. 60