quiz results for certification practice exam

Upload: arvind-shukla

Post on 04-Jun-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 Quiz Results for Certification Practice Exam

    1/29

    Quiz Score: 0%

    You answered 0 out of 50 questions correctly. To see any answer, scroll down or click a question in the gridbelow. When you select links on this page, the information appears in the original browser window.

     Question # 1 2 3 4 5 6 7 8 9 10

     Correct  / Incorrect

     

    11 12 13 14 15 16 17 18 19 20

    21 22 23 24 25 26 27 28 29 30

    31 32 33 34 35 36 37 38 39 40

    41 42 43 44 45 46 47 48 49 50

    1.  A raw data file is listed below.

    1- - - +- - -  -10- - - +- - - - 20- - - +- - -

    01/ 05/ 1989 Fr ank 1112/ 25/ 1987 J une 1301/ 05/ 1991 Sal l y 9

    The following SAS program is submitted using this file as input:

    dat a work. f ami l y;  i nf i l e 'file-specification';  i nput @1 dat e_of _bi r t h mmddyy10.  @15 f i r st _name $5.  @25 age 3;r un;

    pr oc pr i nt data=work. f ami l y noobs;r un;

    The following output is generated for the Work.Family data set:

    Date_of_birth First_name A ge

    10597 Frank .

    10220 June .

    11327 Sally .

    Which of the following statements is true regarding the Work.Family output?

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    9 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    2/29

    a. The output has the expected data values.

    b. The output does not have the expected data values due to an invalid data set name.

    c. The output does not have the expected data values due to an invalid informat for Age only.

    d. The output does not have the expected data values due to invalid informats for both Age and

    Dat e_of _bi r t h.

    Correct answer: c

    Your answer:

    The output for Work.Family does not have the expected data values. The values for the variable Age are

    missing because the program contains an invalid informat for Age. The informat for reading standard numeric

    data is w.d, so the correct informat for Age is 3.. The informat for Dat e_of _bi r t h, mmddyy10., is

    correct.

    2. The following SAS program is submitted:

    dat a empl oyees;

      i nf i l e 'file-specification';  i nput @1 name $10.  @15 dat e dat e9  @25 depar t ment $;r un;

    How many numeric variables are created?

    a. 0

    b. 1

    c. 2

    d. 3

    Correct answer: cYour answer:

    Name and Depar t ment  are created as character variables because they both use the $w. informat. If the

    second line of the INPUT statement was @15 date dat e9. , then the program would create one numeric

    variable named Dat e. However, the period is missing from the informat date9.. Therefore, SAS interprets

    the line as list input rather than formatted input, and creates two numeric variables: Dat e and Dat e9.

    3. What is the function of the FILENAME statement in SAS?

    a. It associates a file reference with an external file.

    b. It associates a library reference with an external file.

    c. It associates a file reference with a relational database.

    d. It associates a library reference with a relational database.

    Correct answer: aYour answer:

    The FILENAME statement associates a file reference with an external file. The LIBNAME statementassociates a library reference with a SAS data library. The LIBNAME statement can also associate a library

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    9 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    3/29

    reference with a relational database if you have the appropriate SAS/ACCESS products licensed for the

    relational database that you need to access. Referencing Files and Setting Opt ions

    4.  A raw data file is listed below.

    1- - - +- - -  -10- - - +- - - - 20- - - +- - -

     J ose, 47, 210

    Sue, , 108

    The following SAS program is submitted using this file as input:

    data empl oyeest ats;  ;  i nput name $ age wei ght ;r un;

    The following output is desired:

    name age weight

    Jose 47 210

    Sue . 108

    Which of the following INFILE statements completes the program and accesses the data correctly?

    a. i nf i l e ' file-specification' pad;

    b.i nf i l e ' file-specification' dsd;

    c.i nf i l e ' file-specification' mi ssover ;

    d.i nf i l e ' file-specification' dl m=' , ' ;

    Correct answer: bYour answer:

    The correct INFILE statement uses the DSD option to read the data with commas as delimiters and usestwo consecutive commas to indicate a missing value. The PAD option specifies that SAS pad variable lengthrecords with blanks. The MISSOVER option prevents SAS from reading past the end of the line whenreading free-formatted data. The DLM= option specifies the comma as the delimiter, but by default

    consecutive delimiters are treated as one delimiter rather than as an indication of a missing value.

    5.  A raw data file is listed below.

    1- - - +- - -  -10- - - +- - - - 20- - - +- - -

    RANCH, 1250, 10MAR2004SPLI T, 1190, 10/ 20/ 2004CONDO, 1400, 17J UN2004 TWOSTORY, 1810, 12/ 31/ 2004RANCH, 1500, 20J AN2004

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    9 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    4/29

    SPLI T, 1615, 08/ 19/ 2004

    The following SAS program is submitted using this file as input:

    data work. condo_r anch;  i nf i l e ' file-specification' dsd;  i nput st yl e $ @;  i f st yl e = ' CONDO' or st yl e = ' RANCH' t hen

      i nput sqf eet sal edat e : dat e9. ;  el se i nput sqf eet sal edate : mmddyy10. ;  r un;

    How many observations does the Work.Condo_ranch data set contain?

    a. 0

    b. 3

    c. 5

    d. 6

    Correct answer: d

    Your answer:

    There are 6 observations in the Work.Condo_ranch data set. The trailing @ in the first INPUT statementholds the record in the input buffer and allows the next INPUT statement that is executed to continue readingfrom the same record. The program uses IF-THEN/ELSE conditional logic to execute either the second or third INPUT statement conditionally based on the value of St yl e. Because of the trailing @ in the first

    INPUT statement, the second or third INPUT statement reads from the same record as the first INPUTstatement. Therefore, each line in the raw data file is read once, which creates a total of 6 observations in

    the output data set.

    6.  A raw data file is listed below.

    1- - - +- - -  -10- - - +- - - - 20- - - +- - - - 30- - - +- - - - 40- - - +- - - - 50 TWOSTORY 1040 2 1SANDERS ROAD $55, 850CONDO 2150 4 2. 5J EANS AVENUE $127, 150

    The following program is submitted using this file as input:

    data work. houses;  i nf i l e 'file-specification';  r un;

    Which one of the following INPUT statements reads the raw data file correctly?

    a.i nput @1 st yl e $8.  +1 sqf eet 4.  +1 bedr ooms 1.  @20 bat hs 3.  st r eet 16.  @40 pr i ce dol l ar8;

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    9 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    5/29

    b.i nput @1 st yl e $8  +1 sqf eet 4.  +1 bedr ooms 1.  @20 bat hs 3.  st r eet $16  @40 pr i ce dol l ar 8. ;

    c.

    i nput @1 st yl e $8.  +1 sqf eet 4.  +1 bedr ooms 1.  @20 bat hs 3.  st r eet $16.  @40 pr i ce dol l ar 8. ;

    d.i nput @1 st yl e $8.  +1 sqf eet 4.  +1 bedr ooms 1.  @20 bat hs 3  st r eet 16.

      @40 pr i ce dol l ar 8. ;

    Correct answer: cYour answer:

    To read formatted input, an INPUT statement requires valid informats. A valid informat always contains a

    period. The correct INPUT statement creates 2 character variables (St yl e and St r eet ) and 4 numeric

    variables (Sqf eet , Bedr ooms, Bat hs, and Pr i ce).

    7. The following SAS program is submitted:data both;  set M F( i n = I NF) ;  i f I NF t hen gen = ' F' ;  el se gen = ' M' ;  by name;r un;

    The SAS data sets Work.M and Work.F are each sorted by the variable Name. The data set Work.M

    contains 10 observations, and the data set Work.F contains 9 observations. How many observations doesthe Work.Both data set contain?

    a. 0b. 9

    c. 10

    d. 19

    Correct answer: d

    Your answer:

    The Work.Both data set contains 19 observations. The valid SET statement contains two input data sets,which causes the input data sets to be concatenated. The IN= data set option creates an indicator variablethat is used to conditionally assign a value to the variable Gen. The variable I nf  indicates whether Work.F

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    9 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    6/29

    contributed data to the current observation. When Work.F contributes to the current observation, the IFstatement is true and the value of Gen is set to F. Otherwise, the IF statement is false and the value of Gen

    is set to M.

    8. The following SAS program is submitted:

    data t est ( dr op=age) ;

      set sashel p. cl ass( keep=name age genderhei ght wei ght ) ;

      dr op=gender;  newage=age+1;r un;

    Sashelp.Class contains 5 variables. What is the result?

    a. No variables are written to the data set Work.Test .

    b. 4 variables are written to the data set Work.Test .

    c. 5 variables are written to the data set Work.Test .

    d. 6 variables are written to the data set Work.Test .

    Correct answer: dYour answer:

    The Work.Test  data set contains 6 variables: Name, Gender , Hei ght , Wei ght , Dr op, and Newage. The

    KEEP= option in the SET statement reads 5 variables from the input data set. The variable Age is read from

    the input data set, but it is dropped from the output data set by the DROP= data set option. There are also

    two new variables created in the DATA step.

    9. The following SAS program is submitted at the start of a new SAS session:

    l i bname sasdat a 'SAS-data-library';dat a sasdat a. sal es;  set sasdat a. sal esdat a;  prof i t =expenses- r evenues;r un;

    pr oc pr i nt dat a=sal es;r un;

    The SAS data set Sasdata.Salesdata has 10 observations. Which one of the following answers explainswhy a report fails to generate?

    a. The DATA step fails to execute.b. The SAS data set Sales does not exist.

    c. The SAS data set Sales has no observations.

    d. The PRINT procedure statement syntax is incorrect.

    Correct answer: bYour answer:

    The LIBNAME statement creates a permanent data library named Sasdata. The DATA statement indicatesthat the new data set Sales will be stored in the permanent library Sasdata. The PRINT procedurereferences a temporary SAS data set, Sales, which is stored in the Work library. At the beginning of the

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    9 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    7/29

    SAS session, Work.Sales does not exist.

    10. The SAS data set Sasdata.Two is listed below.

    Sasdata.Two

    x y

    5 2

    5 4

    3 6

    The following SAS program is submitted:

    data sasuser . one one;  set sasdat a. t wo;  out put one;r un;

    What is the result?

    a. The data set Sasuser.One has 0 observations and the data set One has 0 observations.

    b. The data set Sasuser.One has 0 observations and the data set  One has 3 observations.

    c. The data set Sasuser.One has 3 observations and the data set One has 0 observations.

    d. The data set Sasuser.One has 3 observations and the data set  One has 3 observations.

    Correct answer: bYour answer:

    There are 2 output data sets listed in the DATA statement: the permanent data set Sasuser.One and the

    temporary data set One. The SET statement reads 3 observations from Work.Two. The OUTPUTstatement is used to explicitly output the 3 observations to the Work.One data set. When the OUTPUTstatement is used, it turns off automatic output in the DATA step, so any data set that is listed in the DATAstatement but not in the OUTPUT statement will not have any observations written to it. Because there is noexplicit OUTPUT statement for Sasuser.One, the data step creates Sasuser.One but it has 0 observations.

     

    11. The following SAS program is submitted:

    dat a wor k. new;  y=10;  z=05;

      x=12;  date=mdy( x, y, z) ;r un;

    What is the value of the Dat e variable?

    a. a character string with the value 12/10/05

    b. a character string with the value 10Dec2005

    c. a numeric value of 16780, which represents the SAS date value for December 10, 2005

    d. a numeric value of 121005, which represents the SAS date value for December 10, 2005

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    9 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    8/29

    Correct answer: cYour answer:

    The MDY function creates a numeric value that represents a SAS date value. The arguments in the MDYfunction must be numeric, and they must represent the values for the month, day, and year (in that order).SAS date values are calculated as the number of days from January 1, 1960, to the given date. Therefore,

    the numeric value 16780 represents the SAS date value for December 10, 2005.

    12. The following SAS program is submitted:

    dat a work. r epor t ;  set wor k. sal es_i nf o;  i f qt r ( sal es_dat e) ge 3;r un;

    The SAS data set Work.Sales_info has one observation for each month in the year 2005, and the variable

    Sal es_Date contains a SAS date value for each of the 12 months. How many of the original 12

    observations in Work.Sales_info are written to the Work.Report  data set?

    a. 2

    b. 3

    c. 6

    d. 9

    Correct answer: cYour answer:

    The QTR function extracts a value from 1 to 4 from a SAS date value. This value indicates the quarter of theyear in which the date falls. The quarters are based on a calendar year starting with January. The subsettingIF statement continues to process only when the observation has a Sal es_dat e value that falls in the last 2

    quarters of the year. Because the input data set contains one observation for each month in the year 2005,there are 6 observations written to Work.Report.

    13. The following SAS program is submitted:

    dat a _nul l _;  set ol d( keep=sal es1 sal es2) ;  f i l e ' file-specification' ;  put sal es1 sal es2;r un;

    What is the result?

    a.  A raw data file is created with no delimiter separating the fields.

    b.  A raw data file is created with a space delimiter separating the fields.

    c.  A raw data file is created with a comma delimiter separating the fields.

    d. No raw data file is created. The DATA step fails execution because no delimiter is specified.

    Correct answer: bYour answer:

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    9 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    9/29

    The FILE statement specifies the output file for the DATA step. The PUT statement describes the lines towrite to the raw data file. In this case, the PUT statement is used with list input, so the fields in the output

    are delimited by a blank space.

    14. The following SAS program is submitted:

    dat a _nul l _;  set ol d = l ast ;  put sal es1 sal es2;  i f l ast t hen put ' Thi s i s t he end of t he dat a set ' ;r un;

    Which of the following options creates the variable Last ?

    a. END

    b. EOF

    c. PTOBS

    d. TOTOBS

    Correct answer: aYour answer:

    The END= option creates and names a temporary variable whose value is 1 when the DATA step isprocessing the last observation (otherwise the value is 0). PTOBS, EOF, and TOTOBS are not valid SAS

    options.

    15. The SAS data set One is listed below.

    OneX Y Z

    1 A 27

    1 A 33

    1 B 45

    2 A 52

    2 B 69

    3 B 70

    4 A 82

    4 C 91

    The following SAS program is submitted:

    dat a t wo;  set one;  by x;  i f f i r st . x;r un;

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    9 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    10/29

    pr oc pr i nt data=t wo noobs;r un;

    Which of the following reports is the result?

    a. X Y Z

    1 A 27

    2 A 523 B 70

    4 A 82

    b. X Y Z

    1 A 27

    1 B 45

    2 A 52

    2 B 69

    3 B 70

    4 A 82

    4 C 91

    c. X Y Z

    1 B 45

    2 B 69

    3 B 70

    4 C 91

    d. No report is produced. The PRINT procedure fails because the data set Two is not created in theDATA step.

    Correct answer: a

    Your answer:

    Fi r st . X is a temporary variable that is automatically created to identify the beginning of each BY group.

    Fi r st . X is not included in the output data set Two. The subsetting IF statement in this program is true for 

    the first observation of each BY group. Therefore, the data set Two contains one observation for the first

    instance of each value of X in One.

    16. The following SAS program is submitted:

    l i bname sasdat a ' SAS-data-library ' ;l i bname l abdata ' SAS-data-library ' ;dat a l abdat a. boston  l abdat a. dal l as(dr op=ci t y dest equi pment ) ;  set sasdat a. ci t i es( keep=or i g dest ci t y

    pr i ce equi pment ) ;  i f dest =' BOS' t hen out put l abdat a. bost on;  el se i f dest =' DFW' t hen out put l abdat a. dal l as;r un;

    Which variables are output to both data sets?

    a. Pr i ce and Or i g only

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    29 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    11/29

    b. Ci t y and Equi pment  only

    c. Ci ty, Pr i ce, and Equi pment  only

    d. Ci ty, Pr i ce, Or i g, and Equi pment  only

    Correct answer: aYour answer:

    The DROP= data set option specifies which variables are dropped when the Labdata.Dallas data set is

    created. If neither the DROP= data set option nor the KEEP= data set option is used, then all of thevariables that are read from the input data set are included in the output data set. The KEEP= data setoption in the SET statement specifies which variables to read from the input data set. Therefore, the

    variables that both output data sets contain are the variables that are listed in the KEEP= option in the SET

    statement and are not listed in the DROP= data set option in the DATA statement.

    17. The following SAS program is submitted:

    pr oc cont ent s dat a=sasuser. ai r pl anes;r un;

    What is produced as output?

    a. the code that created the data set Sasuser.Airplanes

    b. the data portion only of the data set Sasuser.Airplanes

    c. the descriptor portion only of the data set Sasuser.Airplanes

    d. the data and descriptor portions of the data set Sasuser.Airplanes

    Correct answer: cYour answer:

    The CONTENTS procedure cannot produce the code that created the data set Sasuser.Airplanes . PROC

    CONTENTS displays only the descriptor portion of the data set. To see a listing of the data portion of thedata set, you can use the PRINT procedure or the REPORT procedure.

    18. Which SAS procedure displays a listing of the observations in the data portion of a SAS data set?

    a. FSLIST

    b. REPORT

    c. TABULATE

    d. CONTENTS

    Correct answer: bYour answer:

    The REPORT procedure displays a listing of the observations in the data portion of the SAS data set. TheFSLIST procedure displays the contents of an external file. The TABULATE procedure displays a tabular report of the observations in the data portion of the SAS data set. The CONTENTS procedure displays the

    descriptor portion of the SAS data set.

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    29 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    12/29

    19. The observations in the SAS data set Work.Test  are ordered by the values of the variable Sal ar y. The

    following SAS program is submitted:

    pr oc sor t dat a=wor k. t est ;  r un;

    Which of the following statements completes the program and sorts the Work.Test  data set by Name in

    descending order?

    a.by desc name;

    b.by name desc;

    c.by descendi ng name;

    d.by name descendi ng;

    Correct answer: cYour answer:

    The SORT procedure orders SAS data set observations by the values of one or more character or numeric

    variables that are listed in the BY statement. The SORT procedure arranges the data in ascending order bydefault. To sort in descending order, the keyword DESCENDING must be included in the BY statement

    before the sort variable. The keyword DESCENDING cannot be abbreviated in the BY statement.

    20. The following SAS program is submitted:

    pr oc sor t dat a=payrol l ;  by Empl oyeeI DNumber ;r un;

    How are the observations sorted?

    a. Payroll is re-created in sorted order by Empl oyeeI DNumber .

    b. Payroll is stored in original order, and a new data set Payroll is created in sorted order by

    Empl oyeeI DNumber .

    c. Payroll is stored in original order, and a new data set Payrollsorted is created in sorted order by Empl oyeeI DNumber .

    d. Payroll is re-created in sorted order by Empl oyeeI DNumber , and a new data set Payroll is

    created in sorted order by Empl oyeeI DNumber .

    Correct answer: aYour answer:

    The SORT procedure orders SAS data set observations by the values of one or more character or numericvariables that are listed in the BY statement. The SORT procedure re-creates and replaces the original datawith the sorted version of the data if the OUT= option is not used. If the OUT= data set is used, a new data

    set is created to hold the sorted data, and the original data remains unchanged.

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    29 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    13/29

    21. Which one of the following SAS programs creates a variable named Ci ty with a value of Chicago?

    a.dat a wor k. ai r por t s;  Ai r por t Code=' or d' ;  i f Ai r port Code=' ORD' Ci t y=' Chi cago' ;r un;

    b.

    dat a wor k. ai r por t s;  Ai r por t Code=' ORD' ;  i f Ai r port Code=' ORD' Ci t y=' Chi cago' ;r un;

    c.dat a wor k. ai r por t s;  Ai r por t Code=' ORD' ;  i f Ai r port Code=' ORD' t hen Ci t y=' Chi cago' ;r un;

    d.dat a wor k. ai r por t s;

      Ai r por t Code=' ORD' ;  i f Ai r port Code=' ORD' ;  t hen Ci t y=' Chi cago' ;r un;

    Correct answer: cYour answer:

    This DATA step uses an IF-THEN statement to conditionally assign the value Chicago to the variable Ci ty.

    The correct syntax for an IF-THEN statement is IF  expression  THEN  statement.

    22. The SAS data set Employees is listed below.

    Employees

    Name Salary

    Patel 60000

    Payne 50000

    El lis 55000

    Liu 45000

    The following SAS program is submitted:

    proc pr i nt data=empl oyees;  wher e name ? ' e' ;r un;

    What is the result?

    a. No observations are written to the report.

    b. The observation for Ellis only is written to the report.

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    29 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    14/29

    c. The observations for Patel and Payne only are written to the report.

    d. The observations for Patel, Payne, and Ellis only are written to the report.

    Correct answer: cYour answer:

    Two observations are written to the report: one for Patel, and one for Payne. The WHERE statement uses?, which is a mnemonic equivalent for the CONTAINS operator. The CONTAINS operator searched for aspecific set of characters within the values of a character variable. The position of the string does not matter,

    but the case does. Because Ellis contains an uppercase E, it is not included in the report.

    23. The following SAS program is submitted:

    dat a r esul t ;  l name="o' r ei l ey";  ;r un;

    Which statement completes the program and creates the variable X with a value of O'Reiley?

    a.x=propcase( l name) ;

    b.x=pr opcase( l name, " ' " ) ;

    c.x=upcase( l name) ;

    d.x=upcase( l name, " ' " ) ;

    Correct answer: bYour answer:

    The PROPCASE function converts all words in an argument to proper case. The PROPCASE function uses adefault list of delimiters if none are specified. The delimiter required to correctly convert the value o'reiley toproper case is a single quotation mark. Because the single quotation mark is not one of the defaultdelimiters, it must be listed as the second argument in the function. The UPCASE function converts all letters

    in the argument to uppercase. There is only one argument for the UPCASE function.

    24. The following SAS program is submitted:

    data work. count ;  i f Or i gi nal Amount = . t hen  Or i gi nal Amount =100;  Addi t i onal I t ems=100;  Or i gi nal Amount = . ;  Tot al Count =( Or i gi nal Amount +Addi t i onal I t ems) +0;r un;

    What is the value of the Total count  variable in the output data set?

    a. 0

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    29 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    15/29

    b. 100

    c. 200

    d. . (missing numeric value)

    Correct answer: dYour answer:

     Arithmetic operators do not ignore missing values. The result of adding a missing value to an expression with

    an arithmetic operator is a missing value. In this program, the value of Or i gi nal Amount  is missing at thebeginning of the DATA step. The IF-THEN logic changes the value of Or i gi nal Amount  to >100. Then, the

    assignment statement for Or i gi nal Amount  changes the value to missing. Therefore, Or i gi nal Amount

    has a missing value when it is used in the expression for the Total Count  assignment statement.

    25. Which SAS program renames two variables?

    a. set work. dept 1  work. dept2( r ename=( j code=j obcode)  ( sal =sal ar y) ) ;

    b. set work. dept 1  work. dept2( r ename=( j code=j obcode  sal =sal ar y)) ;

    c. set work. dept 1  wor k. dept 2 r ename=( j code=j obcode  sal =sal ar y);

    d. set work. dept 1  wor k. dept r ename=j code=j obcode  sal =sal ar y;

    Correct answer: b

    Your answer:

    In the RENAME= data set option, you list the old variable name, followed by an equal sign and the newvariable name. You enclose the variable names in one set of parentheses, and you enclose the entire

    RENAME= option in a second set of parentheses.

    26. The variable Name in the data set Employee has a format of $CHAR9. The variable Name in the data set

    Sales has a format of $CHAR15. The following SAS program is submitted:

    dat a mer ged;  merge empl oyee sal es;  by name;  f or mat name $CHAR12. ;r un;

    What is the format for the variable Name in the data set Merged?

    a. $CHAR.

    b. $CHAR9.

    c. $CHAR12.

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    29 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    16/29

    d. $CHAR15.

    Correct answer: c

    Your answer:

    The FORMAT statement specifies $CHAR12. as the format for the variable Name in the data set Merged.

    By default, the FORMAT attribute is determined by the data set that is listed first in the MERGE statement.If you use a FORMAT statement in the DATA step, then the FORMAT statement overrides the FORMAT

    attribute from the first data set that is listed in the MERGE statement.

    27. What is true of the sum statement in a SAS DATA step program?

    a. It is valid only in conjunction with a SUM function.

    b. It is not valid with the SET, MERGE, and UPDATE statements.

    c. It adds the value of an expression to an accumulator variable and ignores missing values.

    d. It does not retain the accumulator variable value from one iteration of the SAS DATA step to thenext.

    Correct answer: cYour answer:

    The sum statement in the DATA step is used to create an accumulator variable. It adds the value of theexpression to the accumulator variable and ignores missing values. The value of the accumulator variable isretained from one iteration of the SAS DATA step to the next. The sum statement is valid in any DATA step.

    28. What is the correct form of the sum statement in a DATA step?

    a.sumvar 1 var 2;

    b.var1 + var2;

    c.t otal =var1 + var2;

    d.t ot al =sum( var 1, var 2) ;

    Correct answer: b

    Your answer:

    The sum statement specifies the name of an accumulator variable and adds the result of the expression tothat variable. The value is initially set to 0 and is retained. The SUM statement in the PRINT procedure is

    different from the sum statment in the DATA step. There is also a SUM function that can be used in the DATA

    step.

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    29 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    17/29

    29. The following SAS program is submitted:

    dat a one;  address1=' 214 London Cour t ' ;r un;

    data out put ;  set one;

      addr ess1=;r un;

    Which of the following completes the program and changes the word Court to Drive in the value of thevariable Addr ess1?

    a.t r anwr d( addr ess1, ' Cour t ' , ' Dr i ve' )

    b.t r ant ab( addr ess1, ' Cour t ' , ' Dr i ve' )

    c.

    t ransl at e( address1, ' Court ' , ' Dri ve' )

    d.t r ansf or m( addr ess1, ' Cour t ' , ' Dr i ve' )

    Correct answer: aYour answer:

    The TRANWRD function replaces or removes all occurrences of a word in a character string. The TRANTABfunction transcodes a data string by using a translation table. The TRANSLATE function replaces a specific

    character expression. TRANSFORM is not a valid SAS function.

    30. The following SAS program is submitted:

    dat a work. t est ;  t i t l e="Hi t chhi ker ' s Gui de t o t he SAS Language";  wor d=subst r ( t i t l e, 13, 5) ;r un;

    What is the value of the variable Wor d in the output data set?

    a. Guid

    b. ide t

    c. s Guid

    d. Guide to the SAS Language

    Correct answer: aYour answer:

    The SUBSTR function in this program returns a 5-character substring of the value of Ti t l e, beginning at the

    13th character.

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    29 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    18/29

    31. The following SAS program is submitted:

    data work. pr oduct s;  Pr oduct _Number =5461;  I t em=' 1001' ;  I t em_Ref er ence=i t em| | ' / ' | | pr oduct _Number ;r un;

    What is the result?

    a. The variable I t em_r ef er ence is created with a missing value.

    b. The variable  I t em_r ef erence is created with the value 1001/5461.

    c. The variable I t em_r ef er ence is created with the value 1001/ 5461.

    d. The variable I t em_r ef er ence is not created. The program fails to execute because of errors.

    Correct answer: cYour answer:

    The I t em_Ref erence variable is created as a character variable with the value 1001/ 5461, even

    though a numeric variable was concatenated with the value of a character variable. SAS performs automaticnumeric-to-character conversion for the purpose of concatenation. When I t em_Ref erence is created, the

    automatic conversion from numeric to character uses the BEST12. format for conversion, and the leading

    blanks are included in the converted value.

    32. The following SAS program is submitted:

    dat a wor k. mont h;  date=put ( ' 13mar 2000' d, ddmmyy10. ) ;r un;

    What are the type and length of the variable Dat e in the output data set?

    a. The type is numeric and the length is 8 bytes.

    b. The type is numeric and the length is 10 bytes.

    c. The type is character and the length is 8 bytes.

    d. The type is character and the length is 10 bytes.

    Correct answer: dYour answer:

    The PUT function converts numeric variables to character variables. You can use a format as the secondargument to specify how to write the value. The length of a character variable is determined by the width that

    is specified in the format name.

    33.  A SAS program is submitted and the following is written to the SAS log:

    SAS Log

    178 dat a days;179 do i =' SUN' ' MON' ' TUES' ;  - - - - - - - - - - -  388 200

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    29 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    19/29

    ERROR 388- 185: Expect i ng an ar i t hmet i c operator .

    ERROR 300- 322: The symbol i s not r ecogni zed andwi l l be i gnor ed.

    180 day=i ! ! ' DAY' ;181 end;182 r un;

     

    What caused the error?

    a. The list of values should be in parentheses.

    b. The values should be separated by commas.

    c. The values should not be in quotation marks.

    d. Character values are not allowed on a DO loop statement.

    Correct answer: bYour answer:

    Character values are allowed in a DO loop statement. If character values are used in the DO loop statement,

    the values should be separated by commas and enclosed in quotation marks.

    34. The following SAS program is submitted:

    dat a wor k. cl i ent s;  cal l s=6;  do whi l e( cal l s l e 6) ;

      cal l s+1;  end;  cal l s+1;r un;

    What is the result?

    a. The variable Cal l s has a value of 6 in the output data set.

    b. The variable Cal l s has a value of 7 in the output data set.

    c. The variable Cal l s has a value of 8 in the output data set.

    d. The variable Cal l s has no value. The program fails to execute.

    Correct answer: cYour answer:

    The DO WHILE loop checks the validity of the expression at the top of the loop and executes as long as theexpression is true. When the expression is false, the DO loop does not execute. In this program, the value of 

    Cal l s is set to 6 in the assignment statement at the beginning of the DATA step. Therefore, the expression

    in the DO/WHILE loop is true and the loop executes once. The loop increases the value of Cal l s to 7, so

    the loop expression fails and the DATA step continues with the sum statement. At the end of the DATA step,

    the value of Cal l s is 8.

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    29 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    20/29

    35. The following SAS program is submitted:

    dat a st at s;  set r evenue;  ar r ay weekl y{5} mon t ue wed t hu f r i ;    t ot al =weekl y{i }*. 25;  out put ;

      end;r un;

    Which one of the following DO statements completes the program and processes the elements of theweekl y array?

    a. do i =1- 5;

    b. do i =1 to 5;

    c.do weekl y=1 t o 5;

    d.do weekl y{i }=1 to 5;

    Correct answer: bYour answer:

     A simple DO loop can be used to process the elements in the array. When you define a DO loop thatprocesses elements in an array, the index variable name should also be the name that is used for the

    subscript of the array reference.

    36. The following program is submitted:

    dat a work. t est ;  ar r ay di f f _sal es{3};r un;

    Which of the variables are written to the Work.Test data set?

    a. Di f f _sal es only

    b. Di f f _sal es3 only

    c. Di f f _sal es, Di f f _sal es1, Di f f _sal es2

    d. Di f f _sal es1, Di f f _sal es2, Di f f _sal es3

    Correct answer: dYour answer:

    The ARRAY statement creates an array named di f f _sal es. The di f f _sal es array has three elements.

    Because there are no variables referenced in a variable list in this array definition, this ARRAY statement

    creates three numeric variables named Di f f _sal es1, Di f f _sal es2, and Di f f _sal es3.

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    29 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    21/29

  • 8/13/2019 Quiz Results for Certification Practice Exam

    22/29

    st yl e bedr ooms bat hs pr i ce

    CONDO 2

    3

    4

    2

    1. 5

    2. 5

    2. 5

    2. 0

    $80, 050

    $79, 350

    $127, 150

    $110, 700

     TWOSTORY 4

    2

    2

    4

    3. 0

    1. 0

    1. 0

    2. 5

    $107, 250

    $55, 850

    $569, 250

    $102, 950

    Which of the following SAS statements completes the program and creates the desired report?

    a.i d styl e;

    var bedr oom bat hs pr i ce;

    b.i d styl e;var st yl e bedr ooms bat hs pr i ce;

    c.i d styl e;by st yl e;var bedr ooms baths pr i ce;

    d.i d styl e;

    by st yl e;var st yl e bedr ooms bat hs pr i ce;

    Correct answer: cYour answer:

    The ID statement prints the ID variable as the left-most column and suppresses the OBS column. If youspecify a variable in the ID statement and that same variable is listed in the VAR statement, then the variableappears twice in the report. The report lists the ID variable once for each BY group when you use the IDstatement and the BY statement together, with the same variable listed in both statements. The BY lines are

    also suppressed in the report, and the value of the ID variable identifies the BY group.

    39. The following SAS program is submitted:

    pr oc f r eq data=cl ass;r un;

    The SAS data set Class has two character variables and three numeric variables. How many tables aregenerated?

    a. 0

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    29 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    23/29

    b. 2

    c. 3

    d. 5

    Correct answer: dYour answer:

    There are five tables generated. By default, the FREQ procedure generates a report that contains a

    frequency table for every variable in the data set, including both character and numeric variables.

    40. The following SAS program is submitted:

    proc means data=sasuser . houses mean;  r un;

    The following report is produced:

    style N Obs Variable Label Mean

    CONDO 4 bedroomsbaths

    Number of bedroomsNumber of bathrooms

    2.75000002.1250000

    RANCH 4 bedroomsbaths

    Number of bedroomsNumber of bathrooms

    2.25000002.0000000

    SPLIT 3 bedroomsbaths

    Number of bedroomsNumber of bathrooms

    2.66666671.8333333

    TWOSTORY 4 bedroomsbaths

    Number of bedroomsNumber of bathrooms

    3.00000001.8750000

    Which of the following statements completes the program and creates the desired report?

    a. cl ass styl e;

    b.var bedrooms bat hs;

    c.cl ass styl e;var bedrooms bat hs;

    d.var st yl e;cl ass bedr ooms bat hs;

    Correct answer: cYour answer:

    In the desired report, the variable St yl e is a grouping variable, and the variables Bedr ooms and Baths are

    analyzed. In the MEANS procedure, the CLASS statement specifies grouping variables. The VAR statement

    specifies which numeric variables are analyzed.

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    29 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    24/29

    41. The following SAS program is submitted:

    opt i ons pageno=1 number ;pr oc pr i nt data=sasuser . houses;r un;

    proc means dat a=sasuser . shoes;r un;

    The report created by the PRINT procedure generates five pages of output. What is the page number on thefirst page that is generated by the MEANS procedure?

    a. 1

    b. 2

    c. 5

    d. 6

    Correct answer: dYour answer:

    The PAGENO= option specifies a starting page number for the output. The page numbers increment by 1,starting with the value in the PAGENO= option. If the PRINT procedure generates five pages of output, thenthe MEANS procedure output will start on page 6. If you move the OPTIONS statement after the PRINT

    procedure, the MEANS procedure output would start on page 1.

    42. Which one of the following statements describes creating user-defined formats with the FORMAT

    procedure?

    a. User-defined formats cannot end in a number.

    b. The format name can be up to 200 characters in length.

    c. The format name can end with a period in the value statement.

    d. User-defined formats can share a name with a SAS format if they are stored in a differentlocation.

    Correct answer: aYour answer:

    User-defined formats are created using the FORMAT procedure. The name of the user-defined format isspecified in the VALUE statement. The name of the user-defined format must start with a letter or anunderscore, and can continue with any letter, number, or underscore up to 32 characters. However, the nameof the user-defined format cannot end in a number. The name of a user-defined format cannot be the nameof an existing SAS format. When you specify the name of a user-defined format in the VALUE statement, you

    do not use a period.

    43. The following SAS program is submitted:

    ods ht ml f i l e=' newf i l e. ht ml ' ;pr oc pr i nt data=sasuser . houses;r un;

    proc means dat a=sasuser . houses;r un;

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    29 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    25/29

    pr oc f r eq data=sasuser . shoes;r un;

    ods html cl ose;pr oc pr i nt data=sasuser . shoes;r un;

    How many HTML files are created?

    a. 1

    b. 2

    c. 3

    d. 4

    Correct answer: aYour answer:

    This program creates one HTML file named Newfile.html. By default, one HTML file is created for each

    FILE= or BODY= option in the ODS HTML statement. The ODS HTML CLOSE statement closes the openHTML file and ends the output capture. The Newfile.html file contains the output from the PRINT, MEANS,

    and FREQ procedures.

    44. Which statement directs output to an HTML file?

    a. the ODS HTML statement

    b. the HTML statement

    c. the EXPORT statement

    d. the PRINTTO statement

    Correct answer: aYour answer:

    The ODS HTML statement directs output to an HTML file. HTML is an option that can be used in the ODSHTML statement to specify which destination you are opening and/or closing. EXPORT and PRINTTO are

    procedures in SAS, not statements.

    45. The following SAS program is submitted:

    data test;  set i a. f l ts_pts ;

      i f j ob_code=' f l t at 3'  t hen descri pt i on=' Fl i ght At t endant ' ;  l engt h descr i pt i on 8;r un;

    The variable J ob_code is a character variable with a length of 6 bytes. What is the result?

    a. The variable Descri pt i on with a length of 6 bytes is created.

    b. The variable Descri pt i on with a length of 8 bytes is created.

    c. The variables Descri pt i on with a length of 16 bytes is created.

    d. The variable Descri pt i on is not created. The DATA step fails because of errors.

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    29 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    26/29

    Correct answer: dYour answer:

    The DATA step fails because of errors. The LENGTH statement can be used to assign a length to acharacter or numeric variable. When this code is compiled, SAS encounters descr i pt i on in the

    assignment statement before the LENGTH statement, and descr i pt i on is set to a character variable with

    a length of 16. When the LENGTH statement compiles, there is a conflict because the LENGTH statementattempts to assign a numeric length to the character variable Descri pt i on, and the step fails because of 

    the error.

    46. The descriptor and data portions of the Work.Salaries data set are shown below.

     Variable Type Len Pos

    name Char 8 0

    sal ar y Char 8 16

    st at us Char 8 8

    name status salary

    Liz S 15,600

    Herman S 26,700

    Marty S 35,000

    The following SAS program is submitted:

    pr oc pr i nt dat a=wor k. sal ar i es;  where sal ar y

  • 8/13/2019 Quiz Results for Certification Practice Exam

    27/29

    47. The following SAS program is submitted:

    dat a wor k. t ot al sal es;  set work. mont hl ysal es( keep=year pr oduct sal es) ;  r etai n mont hsal es{12};  ar r ay mont hsal es{12};  do i =1 t o 12;  mont hsal es{i }=sal es;  end;

      cnt+1;  mont hsal es{cnt }=sal es;r un;

    The data set named Work.Monthlysales  has one observation per month for each of five years for a total of 60 observations. What is the result?

    a. The program fails execution because of data errors.

    b. The program fails execution because of syntax errors.

    c. The program runs with warnings and creates the Work.Totalsales data set with 60observations.

    d. The program runs without errors or warnings and creates the Work.Totalsales data set with 60

    observations.

    Correct answer: bYour answer:

    The program fails to execute because there is a syntax error in the RETAIN statement. The curly bracketsare used to define the array elements in the ARRAY statement. Curly brackets are not used to define the

    initial value for a variable in the RETAIN statement.

    48. Which one of the following TITLE statements displays Jane's Dog as the title of SAS output?

    a.t i t l e "J ane"s Dog";

    b.t i t l e ' J ane"s Dog' ;

    c.t i t l e " J ane' s Dog";

    d.t i t l e ' J ane' ' ' s Dog' l

    Correct answer: cYour answer:

    To hide an unmatched single quotation mark, you surround the title text with matched double quotation

    marks. SAS expects single and double quotation marks to be in pairs.

    49. The data set Work.Allmonths contains four quarters of data. A DATA step is submitted and a portion of theSAS log is shown below.

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    29 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    28/29

    SAS Log

    208 data ar r ays;209 set work. al l mont hs( keep=quar t er num_sol d) ;210 by quar t er ;211 ar r ay sol d{3};212 i f f i r st . quar t er t hen cnt =1;213 sol d{cnt }=num_sol d;214 cnt +1;

    215 i f l ast . quar t er t hen out put ;216 r un;

    ERROR: Ar r ay subscr i pt out of r ange at l i ne 213col umn 4. quar t er=2 num_sol d=3 FI RST. quar t er=0LAST. quar t er=1 sol d1=. sol d2=. sol d3=. cnt=4

     _ERROR_=1 _N_=7NOTE: The SAS Syst em st opped pr ocessi ng t hi s st epbecause of err or s.NOTE: There were 8 obser vat i ons r ead f r om t he

    dat aset WORK. ALLMONTHS.WARNI NG: The data set WORK. ARRAYS may be i ncompl et e.

    When thi s st ep was st opped ther e were 1

    observat i ons and 6 var i abl es.WARNI NG: Dat a set WORK. ARRAYS was not r epl aced

    because t hi s s t ep was st opped.NOTE: DATA st at ement used:  r eal t i me 0. 10 seconds

    Which of the following answers would correct the error message?

    a. Reverse the order of lines 213 and 214.

    b. Increase the ARRAY dimension to a value of 4.

    c. Sort the Work.Allmonths data set in descending order by the Quart er variable.

    d.  Add a WHERE= data set option to the Work.Allmonths data set to limit values of the variable

    Cnt  to 3 or less.

    Correct answer: bYour answer:

    There are three dimensions in the sol d array and four quarters of data. When the Cnt  variable has a value

    of 4, the value exceeds the specified range in the array and causes SAS to stop processing. Because thereare four quarters, increasing the array dimension value to 4 will accommodate all of the elements within the

    array.

    50. The following SAS program is submitted:

    data test;  i nf i l e ' file-specification' ;  i nput count r y $ amount ;r un;

    Which one of the following automatic variables can be used to test whether a value for the variable Amount

    is non-numeric?

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9

    29 10/22/2013

  • 8/13/2019 Quiz Results for Certification Practice Exam

    29/29

    a.  _N_

    b.  _ERROR_

    c.  _NUMERIC_

    d.  _CHARACTER_

    Correct answer: bYour answer:

     _ERROR_  is an automatic variable that is created by the DATA step. _ERROR_  records when an error isencountered. The value of _ERROR_  is set to 0 by default, and the value changes to 1 when an input error 

    occurs. _N_  is an automatic variable that is created by the DATA step. The value of  _N_  represents the

    number of times the DATA step has iterated. _NUMERIC_ and _CHARACTER_ are not automatic DATA step

    variables; they are reserved names for use as variable name lists.

    Copyright © 2008 SAS Institute Inc., Cary, NC, USA. All rights reserved.

     

    Results for Certification Practice Exam https://support.sas.com/edu/OLTRN/61030/m0001/base9