Premium

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



Question : The following SAS program is submitted:

libname sasdata 'SAS-data-library';
data test;
set sasdata.chemists;
if jobcode = 'Chem2'
then description = 'Senior Chemist';
else description = 'Unknown';
run;
A value for the variable JOBCODE is listed below:
JOBCODE
chem2
Which one of the following values does the variable DESCRIPTION contain?

 :  The following SAS program is submitted:
1. Chem2
2. Unknown
3. Senior Chemist
4. ' ' (missing character value)

Correct Answer : 2

is it because of the case of the string chem2 instead of Chem2. If is case sensitive and considers if jobcode = 'Chem2' as false. 'unknown is the answer. Chem2 is in inverted comma.
if any word is in inverted comma than sas will be case sensitive for that word.




Question : The following SAS program is submitted:

data work.flights;
destination = 'cph';
select(destination);
when('LHR') city = 'London';
when('CPH') city = 'Copenhagen';
otherwise city = 'Other';
end;
run;
Which one of the following is the value of the CITY variable?

 :  The following SAS program is submitted:
1. Other
2. Copenh
3. Copenhagen
4. ' ' (missing character value)

Correct Answer :1
Notice that the LENGTH statement in the DATA step above specifies a length
of 20 for Group. Remember that without the LENGTH statement, values for
Group might be truncated, as the first value for Group (Flight Attendant I) is
not the longest possible value.
Warning When you are comparing values in the when-expression, be sure to
express the values exactly as they are coded in the data. For example
when-expression below would be evaluated as false because the values for
JobCode in Sasuser.Payrollmaster are stored in uppercase letters.
when ("fa1") group="Flight Attendant I";
In this case, given the SELECT group above, Group would be assigned
the value Other.


Based on this, the answer would be Copenh (choice B)due to omitting a length statement, but the answer is actually going to be Other (choice A) because 'cph' and When ('CPH') do not
agree in case.





Question :

The following SAS program is submitted:

data work.flights;
destination = 'CPH';
select(destination);
when('LHR') city = 'London';
when('CPH') city = 'Copenhagen';
otherwise;
end;
run;

Which one of the following is the value of the CITY variable?

 :
1. London
2. Copenh
3. Copenhagen
4. ' ' (missing character value)

Correct Answer : 2

Notice that the LENGTH statement in the SELECT group has not been specified. Remember that without the LENGTH statement, values for Group might be truncated, as the first value for
Group (London) is not the longest possible value.




Related Questions


Question : Read the table
Given the SAS data set SASUSER.HOUSES:
Obs style bedrooms baths price sqfeet street
1 CONDO 2 1.5 80050 1200 MAIN
2 CONDO 3 2.5 79350 1300 ELM
3 CONDO 4 2.5 127150 1400 OAK
4 CONDO 2 2.0 110700 1100 FIFTH
5 TWOSTORY 4 3.0 107250 2100 SECOND
6 TWOSTORY 2 1.0 55650 1600 WEST
7 TWOSTORY 2 1.0 69250 1450 NORTH
6 TWOSTORY 4 2.5 102950 2000 SOUTH
The following SAS program is submitted:
proc report data = sasuser.houses nowd headline;
column style price;
where price It 100000;
(insert DEFINE statement here)
define price / mean width = 9 format = dollar12.;
title;
run;
The following output is desired:
styleprice
-------------
CONDO$79,700
TWOSTORY$62550
Which DEFINE statement completes the program and produces the desired output?
 : Read the table
1. define style / width = 9,
2. define style / orderwidth = 9;
3. define style / group width = 9;
4. define style / display width = 9;



Question :
Given the SAS data set WORKAWARDS:
WORK.AWARDS
FNAME POINTS MONTH
----------------------------------
Amy 2 4
Amy 1 7
Gerard 3 3
Wang 3 3
Wang 1 12
Wang 1 8
The following SAS program is submitted:
proc sort data = work.awards;
by descending fname points;
run;
How are the observations sorted
(Select the option from left image)?
 :
1.
2.
3.
4.


Question : The following SAS program is submitted:
libname temp `SAS data library';
data work.new;
set temp.jobs;
format newdate mmddw10.;
mdate = month(newdate);
ddate = weekday(newdate);
run;
proc print data = work.new; run;
The variable NEWDATE contains the SAS date value for April 15. 2005. What output is produced if April
15, 2005 falls on a Friday?

 : The following SAS program is submitted:
1. Obsnewdate mdate ddate
104/15/2005 APR 6
2. Obs newdate mdate ddate
104/15/2005 4 6
3. Obs newdate mdate ddate
104/15/2005 APR 7
4. Obs newdate mdate ddate
104/15/2005 4 7


Question : The following SAS program is submitted:
libname company 'SAS-data-library';
proc sort data = employee.payroll;
by EmployeeIDNumber;
run;
Write access has been granted to the EMPLOYEE library.
Which one of the following represents how the observations are sorted?
 : The following SAS program is submitted:
1. EMPLOYEE.PAYROLL is recreated in sorted order by EmployeeIDNumber.
2. EMPLOYEE.PAYROLL is stored in original order, and a new data set PAYROLL is created in sorted order by
EmployeeIDNumber.
3. EMPLOYEE.PAYROLL is stored in original order, and a new data set COMPANY.PAYROLLSORTED is created in sorted order
by EmployeeIDNumber.
4. EMPLOYEE.PAYROLL is recreated in sorted order by EmployeeIDNumber, and a new data set PAYROLL is created in sorted
order by EmployeeIDNumber.


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 ascending expense values within
each ascending IDNUMBER value?
 : The SAS data set EMPLOYEE_INFO is listed below:
1. by Expenses IDNumber;
2. by IDNumber Expenses;
3. Access Mostly Uused Products by 50000+ Subscribers
4. by ascending IDNumber ascending Expenses;


Question : The SAS data set WORK.AWARDS is listed below:
fname points
Amy 2
Amy 1
Gerard 3
Wang 3
Wang 1
Wang 2
The following SAS program is submitted:
proc sort data = work.awards;
by descending fname points;
run;
Which one of the option from left image represents how the observations are sorted?
 : The SAS data set WORK.AWARDS is listed below:
1.
2.
3. Access Mostly Uused Products by 50000+ Subscribers
4.