base unit test paper_1 solution
TRANSCRIPT
7/23/2019 Base Unit Test Paper_1 Solution
http://slidepdf.com/reader/full/base-unit-test-paper1-solution 1/16
EPOCH RESEARCH INSTITUTE (GUJ) PVT. LTD.
BASE SAS CERTIFICATION EXAM SOLUTION
Test Code ep/Base/A00-211 Author: Krishna Nanavaty Page 1
Version No: ep/No.001/18th Jan 2010
Each carry 1 mark, carries 0.25 negative marking.
1) How many of the following data sets are temporary datasets?
A) Work.employee
B) Prac.employee
C) Base1.employee
D) Employee
2) Which program has the correct syntax for DATA step?
A) Data student
Input no name $;
1
xyz2 abc
;
Run;
B) dta student;
input no name;
1 xyz
2 abc
;
Run;
C) data student;
input no name $;
datalines;
1 xyz
3 abc
;
Run;
3) The following program submitted.
Proc print data = student;
Title1 ‘ Student data’;
Title2 ‘Student of 1st Year’;
Title3 ‘Marks of 1st exam’;
7/23/2019 Base Unit Test Paper_1 Solution
http://slidepdf.com/reader/full/base-unit-test-paper1-solution 2/16
EPOCH RESEARCH INSTITUTE (GUJ) PVT. LTD.
BASE SAS CERTIFICATION EXAM SOLUTION
Test Code ep/Base/A00-211 Author: Krishna Nanavaty Page 2
Version No: ep/No.001/18th Jan 2010
Run;
Proc print data = student;
Title2 ‘ Marks of annual exam’;
Run;
What title appear in the second procedure?
A) Marks of annual exam
B) Student data
Student of 1st year
Marks of 1st year
C)
Student data
Marks of annual exam
D) Student data
Marks of 1st exam
Marks of annual exam
4) The following program submitted.
Proc print data = employee;
Footnote1 ‘Employee data’;
Footnote2 ‘Annual salary report’;
Footnote3 ‘ confidential’;
Run;
Proc print data = employee;
Footnote2 ‘Quarterly salary data’;
Run;
A) Employee data
Quarterly salary data
B) Quarterly salary data
C) Employee data
Annual salary report
ConfidentialD) Employee data
Quarterly salary data
Confidential
5) Proc print data = student;
Label LN = ‘Last Name ‘
FN = ‘First Name’;
7/23/2019 Base Unit Test Paper_1 Solution
http://slidepdf.com/reader/full/base-unit-test-paper1-solution 3/16
EPOCH RESEARCH INSTITUTE (GUJ) PVT. LTD.
BASE SAS CERTIFICATION EXAM SOLUTION
Test Code ep/Base/A00-211 Author: Krishna Nanavaty Page 3
Version No: ep/No.001/18th Jan 2010
Run;
Which option will be used with proc print to print the label in output window?
A)
Label
B) Now
C) Print
D) Split
6) How many statements are in the DATA Step?
Data emp;
Length First_name $ 13
Last_Name $ 20 Salary Jobcode $ 20;
Infile ‘raw-data-file’;
Input First_name $ Last_Name $ salary Jobcode $;
Run;
A) 1
B) 5
C) 7
D) 3
7) Proc contents data = donations;
Run;
What output would you get?
A)
Descriptor portion
B) Data portion
C) Both descriptor and data portion
8) Which of the following is not a valid WHERE expression?
A) Where gender = ‘M’;
B) Where salary ^= 23000;
C) Where city in ( Ahmedabad Baroda);
D) Where salary between 15000 and 30000;
9)
Where name like ‘C_t%’;
Which names will be selected based on the above expression?A) Cat
B) Cattle
C) Camel
D) Cats
10) Which where statement correctly subsets for character days Sunday, Monday or Tuesday and
numeric number with a missing value?
7/23/2019 Base Unit Test Paper_1 Solution
http://slidepdf.com/reader/full/base-unit-test-paper1-solution 4/16
EPOCH RESEARCH INSTITUTE (GUJ) PVT. LTD.
BASE SAS CERTIFICATION EXAM SOLUTION
Test Code ep/Base/A00-211 Author: Krishna Nanavaty Page 4
Version No: ep/No.001/18th Jan 2010
A) Where days in (‘Sunday’, ‘Monday’, ‘Tuesday’) and number = .;
B)
Where days in (‘Sunday’, ‘Monday’, Tuesday) and number = ‘’;
C)
Where days in(Sunday- Tuesday) and number = . ;
11) Which FORMAT statement creates the output?
Birthdate Enrol_date Termdate
20/05/1980 01/03/2005 Jun2005
A) Format birthdate enrol_date mmddyy8. Trem_date mmyy7.;
B) Format birthdate enrol_date ddmmyy10. Term_date monyy7.;
C) Format birthdate enrol_date ddmmyyyy. Term_date mmmyyyy.;
12)
Which statement is true regarding compilation phase?
A)
Data is read directly from the raw data file to PDV.
B) At the bottom of the DATA step, the contents of the PDV are output to the output SAS data
set.
C) When SAS returns to the top of the DATA step, any variable coming from a SAS data set is
set to missing.
13) Complete the following syntax.
PROC FREQ DATA = sas-data-set__________;
_________________;
Run;
A)
Nlevel, table;
B) Nlevels, tables;
C) Var;
D) Where;
14) What is the result of the assignment statement given the values of a and b?
C = a+b/2;
Where a= . and b=19;
A) 5
B) 10
C) 0
D)
. (missing)
15)
What is the result of the assignment statement given the value of num1 and num2?
Num3 = (5+15)/2; where num1=5 and num2=15;
A) 10
B) . (missing)
7/23/2019 Base Unit Test Paper_1 Solution
http://slidepdf.com/reader/full/base-unit-test-paper1-solution 5/16
EPOCH RESEARCH INSTITUTE (GUJ) PVT. LTD.
BASE SAS CERTIFICATION EXAM SOLUTION
Test Code ep/Base/A00-211 Author: Krishna Nanavaty Page 5
Version No: ep/No.001/18th Jan 2010
C) 0
D)
5
16)
To suppress page number and date from output window, which options will you use in options
statement?
A) Nonumber
B) Nodate
C) Both A & B
D) Nopageno
17) The SAS data set admit has 4 variables ID, AGE, HEIGHT, SEX.
Work.admit
ID Age Height Sex
2462 31 66 F
2666 29 61 M
2302 43 71 M
2501 30 67 F
Proc print data = admit;
Var id age height;
Where age>= 30;
Run;
How many variables and observations are in the output data set?
A) 3 variables, 4 observations
B)
2 variables, 3 observations
C)
4 variables, 2 observations
D) 4 variables, 3 observations
18) Which time span is used to interpret two digit year values if the YEARCUTOFF = option is set to
be 1960?
A) 1960-2060
B) 1960-2059
C) 1959-2061
D)
1960-2001
19) What does the following log indicate above your program?
proc print data=sashelp.class
var name sex age;
22
76
ERROR 22-322: Syntax error, expecting one of the
7/23/2019 Base Unit Test Paper_1 Solution
http://slidepdf.com/reader/full/base-unit-test-paper1-solution 6/16
EPOCH RESEARCH INSTITUTE (GUJ) PVT. LTD.
BASE SAS CERTIFICATION EXAM SOLUTION
Test Code ep/Base/A00-211 Author: Krishna Nanavaty Page 6
Version No: ep/No.001/18th Jan 2010
following:
;, (, DATA, DOUBLE, HEADING, LABEL,N, NOOBS, OBS, ROUND, ROWS, SPLIT, STYLE,
UNIFORM, WIDTH.
ERROR 76-322: Syntax error, statement will be ignored.
11 run;
A) SAS identifies a syntax error at the position of the VAR statement
B) SAS is reading VAR as an option in the PROC PRINT statement.
C) SAS has stopped processing the program because of errors.
D) All of the above
20) The SAS dataset patient contains 4 variables AGE, HEIGHT, WEIGHT, FEE.
Work.patient data set is as follow.Age Height Weight Fee
31 61 123 149.75
41 65 137 124.80
21 63 123 149.75
51 71 141 124.80
44 66 141 149.75
If you run the following program, w hat will be the output?
Proc sort data = patient;
By weight age;
Run;
Proc print data = patient noobs;
Run;
A) Age height weight fee
21 63 123 149.75
31 61 123 149.75
41 65 137 124.80
44 66 141 149.75
51 71 141 124.80
B)
Age height weight fee
21 63 123 149.75
31 61 123 149.75
41 65 137 124.80
51 71 141 124.80
44 66 141 149.75
7/23/2019 Base Unit Test Paper_1 Solution
http://slidepdf.com/reader/full/base-unit-test-paper1-solution 7/16
EPOCH RESEARCH INSTITUTE (GUJ) PVT. LTD.
BASE SAS CERTIFICATION EXAM SOLUTION
Test Code ep/Base/A00-211 Author: Krishna Nanavaty Page 7
Version No: ep/No.001/18th Jan 2010
C) Age height weight fee
31 61 123 149.75
21 63 123 149.75
44 66 141 149.75
41 65 137 124.80
51 71 141 124.80
21) Which PROC PRINT step below creates the following output?
Work.flights
Date On Changed Flight
03Feb98 231 19 302
04Feb98 161 5 302
05Feb98 214 14 302
06Feb98 212 9 302
07Feb98 167 11 302
A) proc print data=flights noobs;
var on changed flight;
where on>=160;
run;
B)
proc print data=flights;var date on changed flight;
where changed<3;
run;
C) proc print data=flights label noobs;
var date boarded transferred flight;
label boarded='On' transferred='Changed';
where flight='302';
run;
D)proc print flights noobs;
id date;
var date on changed flight;
where flight='219';
run;
7/23/2019 Base Unit Test Paper_1 Solution
http://slidepdf.com/reader/full/base-unit-test-paper1-solution 8/16
EPOCH RESEARCH INSTITUTE (GUJ) PVT. LTD.
BASE SAS CERTIFICATION EXAM SOLUTION
Test Code ep/Base/A00-211 Author: Krishna Nanavaty Page 8
Version No: ep/No.001/18th Jan 2010
22) librefs remain in effect until
A)
You change them.B) You cancel them.C) You end your SAS session.D) All of the above
23)Which of the following is not created during compilation phase?
A) the data set descriptor
B) the first observation
C) the program data vector
D) the _N_ and _ERROR_ automatic variables
24)What is wrong with this program?
Data prog.update;
Infile ‘inventory.dat’
Input item $ 1-13 idnum $ 15-19 instock 21-22 backorder 24-25;Total = instock + backorder;
Run;
A) missing semicolon on second line
B) missing semicolon on third line
C) incorrect order of variables
D) incorrect variable type
25) If you don’t specify the LIBRARY = option, your formats are stored in
work.formats, and they exist
A) only for current procedure
B) only for current DATA Step.
C) only for the current SAS session.
D) Permanently
26) How many characters can be used in a label?
A) 50
B) 96
C) 203
D) 256
27) The data set employees includes the following variables. Which is a poor
variable for PROC MEANS analysis?
A) empid
7/23/2019 Base Unit Test Paper_1 Solution
http://slidepdf.com/reader/full/base-unit-test-paper1-solution 9/16
EPOCH RESEARCH INSTITUTE (GUJ) PVT. LTD.
BASE SAS CERTIFICATION EXAM SOLUTION
Test Code ep/Base/A00-211 Author: Krishna Nanavaty Page 9
Version No: ep/No.001/18th Jan 2010
B) salary
C) bonus
D) age
28) Which PROC FREQ step produced this table?
Percent Table of Sex by Weight
Weight
Sex <140 140-180 >180 Total
F 11.00 44.00 0.00 55.00
M 0.00 4.00 41.00 45.00
Total 3 9 8 20
11.00 48.00 41.00 100.00
A)
proc freq data=diabetes;
tables sex weight / list;
format weight wtfmt.;
run;
B) proc freq data=diabetes;
tables sex*weight / nocol;
format weight wtfmt.;
run;
C) proc freq data=diabetes;
tables sex weight / norow nocol;
format weight wtfmt.;
run;
D)proc freq data=diabetes;
tables sex*weight / nofreq norow nocol;
format weight wtfmt.;run;
29)How many of the following data sets are permanent data sets?
A)
Work.student
B) Temporary.student
C) Student
7/23/2019 Base Unit Test Paper_1 Solution
http://slidepdf.com/reader/full/base-unit-test-paper1-solution 10/16
EPOCH RESEARCH INSTITUTE (GUJ) PVT. LTD.
BASE SAS CERTIFICATION EXAM SOLUTION
Test Code ep/Base/A00-211 Author: Krishna Nanavaty Page 10
Version No: ep/No.001/18th Jan 2010
D) Sasprac.student
30)The dataset work.productsale has 5 variables Actualsale, Predictedsale country, quarter, and year.
The data work.productsale as follow.
Actualsale Predictedsale Country Quarter Year
925 890 Canada 1 1993
608 846 Canada 1 1993
948 486 US 2 1994353 266 Canada 3 1994
101 217 US 4 1993
561 979 US 3 1994
Proc means data = productsale min max n maxdec=2 nonobs;
Var actualsale ;
Class country;
Run;
What will be the output of above program?
A) Country Minimum Maximum N
US 101.00 948.00 3
Canada 353.00 925.00 3
B)
Country Minimum Maximum N
Canada 101.00 948.00 3
US 353.00 925.00 3
C) Country N obs Minimum Maximum N
US 3 101.00 948.00 3
Canada 3 353.00 925.00 3
31)Using ODS statements, how many types of output can you generate concurrently?
A) Only listing output
B)
2
C) 3
D) As many as you want
32)What is the length of the variable Dept, as created in the DATA step below?
7/23/2019 Base Unit Test Paper_1 Solution
http://slidepdf.com/reader/full/base-unit-test-paper1-solution 11/16
EPOCH RESEARCH INSTITUTE (GUJ) PVT. LTD.
BASE SAS CERTIFICATION EXAM SOLUTION
Test Code ep/Base/A00-211 Author: Krishna Nanavaty Page 11
Version No: ep/No.001/18th Jan 2010
Data work.emp;
Set bank.employee;
Salary + bonus;
If jobcode = ‘S’ then dept = ‘Sales’;
Else dept = ‘Account’;
Length dept $ 12;
Run;
A) 5
B) 7
C)
12
D) 8
33)Consider the IF-THEN statement shown below. When the statement is executed, which expression
is evaluated first?
If marks>=94
And (research = ‘A’ or (project = ‘A’ and Present = ‘A’))
Then grade = ‘A++’;
A) Marks>=94
B)
Research = ‘A’
C)
Project = ‘A’ and present = ‘A’
D)
Research = ‘A’ or (project = ‘A’ and present = ‘A’)
34)If you submit the following program, which variables appear in the new data set?
Data work.emp(drop = age hiredate);
Set bank.employee(keep = age hiredate salary);
If salary >15000 and age > 40;
Run;
A) None
B)
Salary
C) Age salary
D)
Age hiredate salary
35) Which data step will use to combine work.one and work.two to produce work.three?
Work.one
no name
7/23/2019 Base Unit Test Paper_1 Solution
http://slidepdf.com/reader/full/base-unit-test-paper1-solution 12/16
EPOCH RESEARCH INSTITUTE (GUJ) PVT. LTD.
BASE SAS CERTIFICATION EXAM SOLUTION
Test Code ep/Base/A00-211 Author: Krishna Nanavaty Page 12
Version No: ep/No.001/18th Jan 2010
1 Apple
3 Orange
5 Banana
Work.two
No Name2
2 Mango
4 Lichi
Work.three
Obs No Name Name2
1 1 Apple
2 3 Orange
3 5 Banana
4 2 Mango
5 4 Lichi
A) Data work.three;
Set one two;Run;
B) Data fruit.three;
Set one two;
Run;
C)
Data work.three;
Merge one two;
By name;
Run;
36)Which function calculates the average of the variables var1, var2, var3, and var4?
A) Mean(var1, var2)
B) Mean(var1-var4)
C) Mean(of var1, var4)
D)
Mean(of var1-var4)
7/23/2019 Base Unit Test Paper_1 Solution
http://slidepdf.com/reader/full/base-unit-test-paper1-solution 13/16
EPOCH RESEARCH INSTITUTE (GUJ) PVT. LTD.
BASE SAS CERTIFICATION EXAM SOLUTION
Test Code ep/Base/A00-211 Author: Krishna Nanavaty Page 13
Version No: ep/No.001/18th Jan 2010
37)A typical value for the character variable Target is 654,321. Which statement correctly converts
the values of Target to numeric values when creating the variable TargetNo?
A) TargetNo=input(target,comma6.);
B) TargetNo=input(target,comma7.);
C) TargetNo=put(target,comma6.);
D)
TargetNo=put(target,comma7.);
38)Which statement is false regarding DO UNTIL statements?
A)The condition is evaluated at the top of the loop, before the enclosed statements are executed.
B)The enclosed statements are always executed at least once.
C)SAS statements in the DO loop are executed until the specified condition is true.
D)The DO loop must have a closing END statement.
39) How many observations will the data set work.earning contain?
Data work.earning;
Value = 3000;
Do year = 1 to 30;
Interest = value *0.70;
Value + interest;
Output;
End;
Run;
A)0
B)1
C) 19
D) 30
40) Which statement is false regarding an ARRAY statement?
7/23/2019 Base Unit Test Paper_1 Solution
http://slidepdf.com/reader/full/base-unit-test-paper1-solution 14/16
EPOCH RESEARCH INSTITUTE (GUJ) PVT. LTD.
BASE SAS CERTIFICATION EXAM SOLUTION
Test Code ep/Base/A00-211 Author: Krishna Nanavaty Page 14
Version No: ep/No.001/18th Jan 2010
A) It is an executable statement.
B) It can be used to create variables.
C) It must contain either all numeric or all character elements.
D) It must be used to define an array before the array name can be referenced.
41) Finish the ARRAY statement below to create temporary array elements that have initial values of
9100, 9300, 9600, and 9900.
array goal{4} ... ;
A)_temporary_ (9100 9300 9600 9900)
B)temporary (9100 9300 9600 9900)
C)_temporary_ 9100 9300 9600 9900
D)(temporary) 9100 9300 9600 9900
42) What belongs within the braces of this ARRAY statement?
Array subject{?} sub1-sub3;
A)
Subject
B) Subject*
C) 3
D) 1-3
43) Formatted input can be used to read
A) standard free-format data.
B)Standard data in fixed fields
C) nonstandard data in fixed fields.
D) both standard and nonstandard data in fixed fields.
44) An input data file has date expressions in the form 11232009. Which SAS informat should you use to
read these dates?
7/23/2019 Base Unit Test Paper_1 Solution
http://slidepdf.com/reader/full/base-unit-test-paper1-solution 15/16
EPOCH RESEARCH INSTITUTE (GUJ) PVT. LTD.
BASE SAS CERTIFICATION EXAM SOLUTION
Test Code ep/Base/A00-211 Author: Krishna Nanavaty Page 15
Version No: ep/No.001/18th Jan 2010
A) DATE6.
B) DATE8.
C)MMDDYY6.
D)MMDDYY8.
45) Which pointer control is used to read records non-sequentially?
A) @n
B)#n
C)+n
D)/
46) A record that is being held by a single trailing at sign (@) is automatically released when
A) The input pointer moves past the end of the record.
B) The next iteration of the DATA step begins.
C) Another input statement that has a single trailing at sign (@) executes.
D) Another value is read from the observation.
47) What is the default value of the YEARCUTOFF = System option?A)1910
B)1900
C)1920
D)1930
7/23/2019 Base Unit Test Paper_1 Solution
http://slidepdf.com/reader/full/base-unit-test-paper1-solution 16/16
EPOCH RESEARCH INSTITUTE (GUJ) PVT. LTD.
BASE SAS CERTIFICATION EXAM SOLUTION
Test Code ep/Base/A00-211 Author: Krishna Nanavaty Page 16
Version No: ep/No.001/18th Jan 2010
Fill in the blanks.
1) The SUM statement is automatically set to __ZERO_ before SAS reads the first observation.
2) In BY-Group processing, the FIRST.variable is set to __1_ when an observation is the first in a
by group; otherwise, it equals 0.
3) The SORT procedure produces only an __OUTPUT__ data set, but no _REPORT__.
4) The __BY__statement specifies the sorting variables.
5) The ___FIRSTOBS=___ data set option specifies a starting point and ___OBS=__ Dataset
option specifies an ending point for processing an input data set.6)
SAS steps begin with either __DATA_ or __PROC_.
7) The ___Datalines__ statement is used when reading data located directly in the program.
8) The __CONTENTS__ procedure displays the descriptor portion of a SAS data set.
9) ___NUMERIC__ variable type is used by SAS to store date values?
10) SAS variable names must start with __LETTER__ or __UNDERSCORE__.
11) Every SAS statement ends with a __SEMICOLON__.
12) By default, numeric variables are stored in__8__ bytes of storage.
13)
A missing numeric values is displayed as a __PERIOD__.
14)
A libref name must be _8__ characters or less.
15)
The SET statement can read __TEMPORARY__ or __PERMANENT__ data sets.16) __FORMATTED__ input, you can read nonstandard data for which SAS require additional
instructions.
17) To read with list input, data values must be separated with a _DELIMITER__.
18) The _SET__ statement cannot be used to select records from a raw data file.
19) During the processing of every DATA step, SAS automatically creates _ERROR_ and _N_
temporary variables.
20) The __APPEND__ procedure adds the observations from one SAS data set to the end of
another SAS data set.
21) In PROC MEANS, use a __VAR__ statement to limit output to relevant variables.
22)
___FORWARD SLASH (/)___ pointer control is used to read multiple records sequentially.23) The _DOUBLE TRAILING (@@)_ at sign holds a record across multiple iterations of the DATA
Step until the end of the record is reduced,