base unit test paper_1que

Upload: anup-kumar-das

Post on 13-Apr-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/23/2019 Base Unit Test Paper_1Que

    1/14

    Test Code ep/Base/A00211 Author: Krishna Nanavaty Page 1Version No: ep/No.001/18thJan 2010

    EPOCHRESEARCHINSTITUTE(GUJ)PVT.LTD.

    BASE SAS CERTIFICATION EXAM

    Name of Student:______________________________

    Test Taken By: ______________________________

    Test Date: ______________________________________

    Total Marks: _________________________________

    Score: __________________________________________Instruction:

    Please read question carefully before you attempt it.

    Total marks: 70 (Each carry 1 mark, and carries 0.25 negative marking system.)

    Passing percentage: 65%

    Total Time: 2 Hours

    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 xyz

    2 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;

  • 7/23/2019 Base Unit Test Paper_1Que

    2/14

    Test Code ep/Base/A00211 Author: Krishna Nanavaty Page 2Version No: ep/No.001/18thJan 2010

    3) The following program submitted.

    Proc print data = student;

    Title1 Student data;

    Title2 Student of 1stYear;

    Title3 Marks of 1stexam;

    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 1styear

    Marks of 1styear

    C) Student data

    Marks of annual exam

    D) Student data

    Marks of 1stexam

    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 dataQuarterly salary data

    B) Quarterly salary data

    C) Employee data

    Annual salary report

    Confidential

    D) Employee data

    Quarterly salary data

    Confidential

    5) Proc print data = student;

    Label LN = Last Name FN = First Name;

    Run;

    Which option will be used with proc print to print the label in output window?

    A) Label

    B) Now

    C) Print

    D) Split

  • 7/23/2019 Base Unit Test Paper_1Que

    3/14

    Test Code ep/Base/A00211 Author: Krishna Nanavaty Page 3Version No: ep/No.001/18thJan 2010

    6) How many statements are in the DATA Step?

    Data emp;

    Length First_name $ 13

    Last_Name $ 20 Salary Jobcode $ 20;

    Infile rawdatafile;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 portionB) 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)

    CatB) 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?

    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 1/03/2005 June2005

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

  • 7/23/2019 Base Unit Test Paper_1Que

    4/14

    Test Code ep/Base/A00211 Author: Krishna Nanavaty Page 4Version No: ep/No.001/18thJan 2010

    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 = sasdataset__________;

    _________________;

    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;

    A) 10

    B) . (missing)

    C)

    0D) 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

  • 7/23/2019 Base Unit Test Paper_1Que

    5/14

    Test Code ep/Base/A00211 Author: Krishna Nanavaty Page 5Version No: ep/No.001/18thJan 2010

    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 M2302 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 window?

    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) 19602060

    B) 19602059

    C) 19592061

    D) 19602001

    19)What does the following log indicate above your program?pr oc pr i nt dat a=sashel p. cl ass

    var name sex age;22

    76ERROR 22- 322: Synt ax er r or , expect i ng one of t hef ol l owi ng:

    ; , ( , DATA, DOUBLE, HEADI NG, LABEL,N, NOOBS, OBS, ROUND, ROWS, SPLI T, STYLE,UNI FORM, WI DTH.

    ERROR 76- 322: Synt ax er r or , st atement wi l l be i gnored.11 run;

    A) SAS i dent i f i es a synt ax er r or at t he posi t i on of t he VAR st at ementB) SAS i s r eadi ng VAR as an opt i on i n t he PROC PRI NT st atement .C) SAS has st opped processi ng t he pr ogr ambecause of err or s.D) Al l of t he above

    20)

    The SAS dataset patient contains 4 variables AGE, HEIGHT, WEIGHT, FEE.Work.patient data set is as follow.

    Age Height Weight Fee31 61 123 149.75

    41 65 137 124.80

    21 63 123 149.7551 71 141 124.80

    44 66 141 149.75

  • 7/23/2019 Base Unit Test Paper_1Que

    6/14

    Test Code ep/Base/A00211 Author: Krishna Nanavaty Page 6Version No: ep/No.001/18thJan 2010

    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.8044 66 141 149.75

    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?

    Date On Changed Flight

    03Feb98 231 19 302

    04Feb98 161 5 30205Feb98 214 14 302

    06Feb98 212 9 302

    07Feb98 167 11 302

    A)

    r oc pr i nt dat a=f l i ght s noobs;

    var on changed f l i ght ;

    wher e on

  • 7/23/2019 Base Unit Test Paper_1Que

    7/14

    Test Code ep/Base/A00211 Author: Krishna Nanavaty Page 7Version No: ep/No.001/18thJan 2010

    C) pr oc pr i nt dat a=f l i ght s l abel noobs;

    var dat e boar ded t r ansf er r ed f l i ght ;

    l abel boar ded=' On' t r ansf err ed=' Changed' ;

    wher e f l i ght =' 302' ;

    r un;

    D) pr oc pr i nt f l i ght s noobs;

    i d dat e;var dat e on changed f l i ght ;

    wher e f l i ght =' 219' ;

    r un;

    22)

    l i br ef s remai n i n ef f ect unt i lA) You change t hem.B) You cancel t hem.C) You end your SAS sessi on.D)

    Al l of t he above

    23) Whi ch of t he f ol l owi ng i s not cr eat ed dur i ng compi l at i on phase?A) t he dat a set descr i pt or

    B) t he f i r st obser vat i onC) t he pr ogr am dat a vect orD) t he _N_ and _ERROR_ aut omat i c var i abl es

    24) What i s wr ong wi t h t hi s pr ogr am?Data pr og. updat e;

    I nf i l e i nvent or yI nput i t em $ 1- 13 i dnum $ 15- 19 i nst ock 21- 22 backor der 24- 25;Tot al = i nst ock + backor der ;

    Run;A) mi ssi ng semi col on on second l i neB)

    mi ssi ng semi col on on t hi r d l i neC) i ncor r ect or der of var i abl esD)

    i ncor r ect var i abl e t ype

    25) I f you don t speci f y the LI BRARY = opt i on, your f ormats ar e st ored i nwork. f ormat s, and t hey exi st

    A) onl y f or cur r ent pr ocedur e

    B) onl y f or cur r ent DATA St ep.

    C) onl y f or t he cur r ent SAS sessi on.

    D) Permanent l y

    26) How many char act er s can be used i n a l abel ?A) 50

    B) 96

    C) 203

    D) 256

  • 7/23/2019 Base Unit Test Paper_1Que

    8/14

    Test Code ep/Base/A00211 Author: Krishna Nanavaty Page 8Version No: ep/No.001/18thJan 2010

    27) The dat a set empl oyees i ncl udes t he f ol l owi ng var i abl es. Whi ch i s apoor var i abl e f or PROC MEANS anal ysi s?

    A) empi d

    B) sal ar y

    C) bonus

    D) age

    28) Whi ch PROC FREQ st ep produced t hi s t abl e?

    Per cent Tabl e of Sex by Wei ght

    Wei ght

    Sex 180 Tot al

    F 11. 00 44. 00 0. 00 55. 00

    M 0. 00 4. 00 41. 00 45. 00

    Tot al 3 9 8 20

    11. 00 48. 00 41. 00 100. 00

    A) pr oc f r eq dat a=di abet es;t abl es sex wei ght / l i st;

    f ormat wei ght wt f mt . ;

    r un;B)

    pr oc f r eq dat a=di abet es;t abl es sex*wei ght / nocol ;

    f ormat wei ght wt f mt . ;r un;

    C) pr oc f r eq dat a=di abet es;t abl es sex wei ght / norow nocol ;f ormat wei ght wt f mt . ;

    r un;D) pr oc f r eq dat a=di abet es;

    t abl es sex*wei ght / nof r eq norow nocol ;f ormat wei ght wt f mt . ;

    r un;

    29)How many of the following data sets are permanent data sets?

    A) Work.student

    B) Temporary.student

    C) Student

    D) Sasprac.student

  • 7/23/2019 Base Unit Test Paper_1Que

    9/14

    Test Code ep/Base/A00211 Author: Krishna Nanavaty Page 9Version No: ep/No.001/18thJan 2010

    30)The dataset work.productsale has 5 variables Actualsale, Predictedsale country, quarter, and

    year.

    The data work.productsale as follow.

    Actualsale Predictedsale Country Quarter Year925 890 Canada 1 1993608 846 Canada 1 1993

    948 486 US 2 1994

    353 266 Canada 3 1994

    101 217 US 4 1993561 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?

    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

  • 7/23/2019 Base Unit Test Paper_1Que

    10/14

    Test Code ep/Base/A00211 Author: Krishna Nanavaty Page 10Version No: ep/No.001/18thJan 2010

    33)Consider the IFTHEN 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>=94B) 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

    1 Apple

    3 Orange5 Banana

    Work.two

    No Name2

    2 Mango4 Lichi

    Work.three

    Obs No Name Name2

    1 1 Apple

    2 3 Orange3 5 Banana

    4 2 Mango

    5 4 Lichi

    A) Data work.three;

    Set one two;

    Run;

    B) Data fruit.three;

  • 7/23/2019 Base Unit Test Paper_1Que

    11/14

    Test Code ep/Base/A00211 Author: Krishna Nanavaty Page 11Version No: ep/No.001/18thJan 2010

    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(var1var4)

    C) Mean(of var1, var4)

    D) Mean(of var1var4)

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

    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

  • 7/23/2019 Base Unit Test Paper_1Que

    12/14

    Test Code ep/Base/A00211 Author: Krishna Nanavaty Page 12Version No: ep/No.001/18thJan 2010

    40) Which statement is false regarding an ARRAY statement?

    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{?} sub1sub3;

    A) Subject

    B) Subject*

    C) 3

    D) 13

    43) Formatted input can be used to read

    A) standard freeformat 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?

    A) DATE6.

    B) DATE8.

    C)MMDDYY6.

    D)MMDDYY8.

  • 7/23/2019 Base Unit Test Paper_1Que

    13/14

    Test Code ep/Base/A00211 Author: Krishna Nanavaty Page 13Version No: ep/No.001/18thJan 2010

    45) Which pointer control is used to read records nonsequentially?

    A) @n

    B)#n

    C)+n

    D)/

    46) A record that is being held by a single trailing at sign (@) is automatically released whenA) 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)1910B)1900C)1920D)1930

  • 7/23/2019 Base Unit Test Paper_1Que

    14/14

    Test Code ep/Base/A00211 Author: Krishna Nanavaty Page 14Version No: ep/No.001/18thJan 2010

    Fill in the blanks.

    1) The SUM statement is automatically set to ___________ before SAS reads the first

    observation.

    2) In BYGroup processing, the FIRST.variable is set to ____________ when an observation is

    the first in a by group; otherwise, it equals 0.

    3)

    The SORT procedure produces only an __________ data set, but no _______________.

    4) The _________ statement specifies the sorting variables.

    5) The ___________________ data set option specifies a starting point and _______________

    Dataset option specifies an ending point for processing an input data set.

    6) SAS steps begin with either ____________________ or __________________.

    7) The ________________ statement is used when reading data located directly in the program.

    8) The ____________ procedure displays the descriptor portion of a SAS data set.

    9) _____________ variable type is used by SAS to store date values?

    10)SAS variable names must start with ___________ or ________________.

    11)Every SAS statement ends with a __________________.

    12)By default, numeric variables are stored in ___________________ bytes of storage.

    13)

    A missing numeric values is displayed as a ______________.14)A libref name must be ___ characters or less.

    15)The SET statement can read ____________ or _______________ data sets.

    16)____________ 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 ____________.

    18)The ____________ statement cannot be used to select records from a raw data file.

    19)During the processing of every DATA step, SAS automatically creates __________ and

    _______ temporary variables.

    20)The _____________ procedure adds the observations from one SAS data set to the end of

    another SAS data set.

    21)

    In PROC MEANS, use a ___________ statement to limit output to relevant variables.22)______ pointer control is used to read multiple records sequentially.

    23)The _____________ at sign holds a record across multiple iterations of the DATA Step until

    the end of the record is reduced,