Premium

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



Question :

The following SAS program is submitted:

data work.new;
length word $7;
amount = 4;
if amount = 4 then word = 'FOUR';
else if amount = 7 then word = 'SEVEN';
else word = 'NONE!!!';
amount = 7;
run;

Which one of the following represents the values of the AMOUNT and WORD variables?

 :
1. amount word
7 FOUR
2. amount word
7 SEVEN
3. amount word
4 FOUR
4. amount word
4 ' ' (missing character value)



Correct Answer : 1 SAS reads the first amount 4 and we get the fist obs
4 four
as the sas reads amount = 7 then output, then it replaces the amount 4 to 7.
we get a output like this.
7 four




Question :

The SAS data set EMPLOYEE_INFO is listed below:

IDNumber Expenses
2542 100.00
3612 133.15
2198 234.34
2198 111.12
The following SAS program is submitted:
proc sort data = employee_info;

run;
Which one of the following BY statements completes the program and sorts the data sequentially by descending expense values within
each descending IDNUMBER value?
 :
1. by descending IDNumber Expenses;
2. by (IDNumber Expenses) descending;
3. by IDNumber descending Expenses descending;
4. by descending IDNumber descending Expenses;


Correct Answer : 4

For each variable we have to mention descending keyword before variable name.
sort variables.

ascending is default

so
Descending Var1 Descending var2





Question :

The SAS data set QTR1_REVENUE is listed below:

destination revenue
YYZ 53634
FRA 62129
FRA 75962
RDU 76254
YYZ 82174
The following SAS program is submitted:
proc sort data = qtr1_revenue;
by destination descending revenue;
run;

Which one of the following represents the first observation in the output data set?
 :
1. destination revenue
YYZ 82174
2. destination revenue
YYZ 53634
3. destination revenue
FRA 62129
4. destination revenue
FRA 75962

Correct Answer : 4 Ascending destionaiton, descdending revenue. The word descending only modifies the variable directly after it.

so "by destination descending revenue" causes destination to be in ascending order (A,B,C,D,E,F,G)and revenue will be in descending order (9,8,7,6,5,4,3).



Related Questions


Question : The observations in the SAS data set EMPLOYEE.TEST are ordered by the values of the variable SALARY.
The following SAS program is submitted:
proc sort data = employee.test out = employee.testsorted;
by name;
run;
Which one of the following is the result of the SAS program?
 : The observations in the SAS data set EMPLOYEE.TEST are ordered by the values of the variable SALARY.
1. The data set EMPLOYEE.TEST is stored in ascending order by values of the NAME variable.
2. The data set EMPLOYEE.TEST is stored in descending order by values of the NAME variable.
3. Access Mostly Uused Products by 50000+ Subscribers
4. The data set EMPLOYEE.TESTSORTED is stored in descending order by values of the NAME variable.


Question : Which one of the following statements is true regarding the name of a SAS array?

 : Which one of the following statements is true regarding the name of a SAS array?
1. It is saved with the data set.
2. It can be used in procedures.
3. Access Mostly Uused Products by 50000+ Subscribers
4. It can be the same as the name of a variable in the data set.


Question : The following SAS program is submitted:
data stats;
set revenue;
array weekly{5} mon tue wed thu fri;

total = weekly{i} * .25;
output;
end;
run;
Which one of the following DO statements completes the program and processes the elements of the WEEKLY array?
 : The following SAS program is submitted:
1. do i = 1 to 5;
2. do weekly{i} = 1 to 5;
3. Access Mostly Uused Products by 50000+ Subscribers
4. A DO loop cannot be used because the variables referenced do not end in a digit.


Question : The following SAS program is submitted:
data work.test;
array agents{4} $ 12 sales1 - sales4;
run;
Which one of the following represents the variables that are contained in the output data set?
 : The following SAS program is submitted:
1. SALES1, SALES2, SALES3, SALES4
2. AGENTS1, AGENTS2, AGENTS3, AGENTS4
3. Access Mostly Uused Products by 50000+ Subscribers
4. None, the DATA step fails because the ARRAY statement can reference only pre-existing variables.


Question : The following SAS program is submitted:
data work.test;
set work.staff (keep = jansales febsales marsales);
array diff_sales{3} difsales1 - difsales3;
array monthly{3} jansales febsales marsales;
run;
Which one of the following represents the new variables that are created?
 : The following SAS program is submitted:
1. JANSALES, FEBSALES and MARSALES
2. MONTHLY1, MONTHLY2 and MONTHLY3
3. Access Mostly Uused Products by 50000+ Subscribers
4. DIFF_SALES1, DIFF_SALES2 and DIFF_SALES3


Question : On which portion(s) of a SAS data set does the PRINT procedure report?

 : On which portion(s) of a SAS data set does the PRINT procedure report?
1. the data portion only
2. the descriptor portion only
3. Access Mostly Uused Products by 50000+ Subscribers
4. neither the data portion nor the descriptor portion