SAS Chapter 17: Formatting Data

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Moxleyv
M
Moxleyv
Community Contributor
Quizzes Created: 38 | Total Attempts: 21,441
Questions: 10 | Attempts: 242

SettingsSettingsSettings
SAS Quizzes & Trivia

Practice for the advance SAS certification exam


Questions and Answers
  • 1. 

    Which SAS system option is used to identify format catalogs to SAS?

    • A.

      FMTERR

    • B.

      FMTLIB

    • C.

      NOFMTERR

    • D.

      FMTSEARCH=

    Correct Answer
    D. FMTSEARCH=
    Explanation
    By default, SAS searches for custom formats in the Work and Library libraries. The FMTSEARCH= system option specifies other catalogs to search when a format is referenced.

    Rate this question:

  • 2. 

    Given the following PROC FORMAT step, how is the value 70 displayed when the AGEGRP. format is applied? proc format; picture agegrp 1-<13='00 Youth' 13-<20='00 Teen' 20-<70='00 Adult' 70-high='000 Senior'; run;

    • A.

      000 Senior

    • B.

      70 Adult

    • C.

      70 Senior

    • D.

      070 Senior

    Correct Answer
    C. 70 Senior
    Explanation
    A non-inclusive range is used such that the age at the high end of the range is not included. To create the picture format, three zeros are used to create a position for a three-digit numeric value. Because zero is used as a digit selector rather than a nonzero value, leading zeros are not included in the formatted value.

    Rate this question:

  • 3. 

    When the NOFMTERR system option is in effect, what happens when SAS encounters a format it cannot locate?

    • A.

      Creates the format in the default Work.Formats directory and continues processing.

    • B.

      Substitutes the $w.or w. format and continues processing.

    • C.

      Stops processing and writes an error message to the log.

    • D.

      Skips processing at that step and continues with the next step and writes a note to the log.

    Correct Answer
    B. Substitutes the $w.or w. format and continues processing.
    Explanation
    By default, FMTERR is in effect and SAS stops processing if it cannot find a format that is referenced. When NOFMTERR is in effect, SAS substitutes the $w. or w. format and continues processing.

    Rate this question:

  • 4. 

    Which of the following variables must be in the data set that is specified on the CNTLIN= option?

    • A.

      End

    • B.

      FmtName

    • C.

      Value

    • D.

      Description

    Correct Answer
    B. FmtName
    Explanation
    A data set that is used to create a format with the CNTLIN= option must have the variables FmtName, Start, and Label. If a range is specified, it must also include the variable End.

    Rate this question:

  • 5. 

    Given the following code, what option is missing? proc format; value times (?)  '00:00't-'04:59't = 'Red Eye' '05:00't-'11:59't = 'Morning' '12:00't-'17:59't = 'Afternoon' '18:00't-'23:59't = 'Evening' '00:00't-'11:59't = 'AM' '12:00't-'23:59't = 'PM'; run;

    • A.

      MULTILABEL

    • B.

      MULTIRANGE

    • C.

      MLF

    • D.

      MULTIFORMAT

    Correct Answer
    A. MULTILABEL
    Explanation
    The format created by this value statement has overlapping ranges, so the MULTILABEL option must be used. A multilabel format can be used by any procedure that supports the MLF option.

    Rate this question:

  • 6. 

    Which PROC FORMAT option is used to create a SAS data set from a format?

    • A.

      CNTLIN=

    • B.

      LIB=

    • C.

      CNTLOUT=

    • D.

      FMTLIB

    Correct Answer
    C. CNTLOUT=
    Explanation
    The CNTLOUT= option is used to create a SAS data set from a format.

    Rate this question:

  • 7. 

    Given the following OPTIONS statement, in what order will SAS search to find a user-defined format? options fmtsearch=(work abc.newfmt sasuser);

    • A.

      Work.Formats   Abc.Newfmt   Sasuser.Formats   Library.Formats

    • B.

      Work.Formats   Library.Formats   Abc.Newfmt   Sasuser.Formats

    • C.

      Work.Formats   Abc.Newfmt   Sasuser.Format

    • D.

      The default search order

    Correct Answer
    B. Work.Formats   Library.Formats   Abc.Newfmt   Sasuser.Formats
    Explanation
    SAS will search in the order specified on the FMTSEARCH= option. By default, SAS searches in the Work and Library libraries first unless they are specified on the option. Because Library is not specified here, it is searched after Work.

    Rate this question:

  • 8. 

    What option is used with PROC FORMAT to document the formats in a particular format catalog?

    • A.

      FMTSEARCH

    • B.

      FMTERR

    • C.

      CATALOG

    • D.

      FMTLIB

    Correct Answer
    D. FMTLIB
    Explanation
    The FMTLIB keyword is used to document the formats in a catalog. You can use the SELECT and EXCLUDE statements to process specific formats rather than the entire catalog.

    Rate this question:

  • 9. 

    Which set of statements would you add to the PROC CATALOG code to copy the LEVELS. and $PICKS. formats from theSasuser.Formats catalog to the Work.Formats catalog? proc catalog cat=sasuser.formats; ?  ?  run;

    • A.

      copy out=sasuser.formats; select levels.format $picks.format;

    • B.

      copy out=work.formats; select levels $picks;

    • C.

      copy out=work.formats; select levels.format picks.formatc;

    • D.

      copy out=work.formats; select levels.format $picks.format;

    Correct Answer
    C. copy out=work.formats; select levels.format picks.formatc;
    Explanation
    In the COPY statement, OUT= specifies the catalog to which you want to copy the format catalog entry. In the SELECT statement you specify the catalog entries by their entire name. Remember that numeric formats are stored with the extension .FORMAT and character formats are stored with the extension .FORMATC.

    Rate this question:

  • 10. 

    Given the following PROC FORMAT step, how is the value 6.1 displayed when the SKICOND format is applied? proc format; value skicond 0-3='Poor' 3<-6='Fair' 6<-9='Good' 9<-high='Excellent'; run;

    • A.

      6.1

    • B.

      Fair

    • C.

      Good

    • D.

      .

    Correct Answer
    C. Good
    Explanation
    The value 6.1 falls in the range 6

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 20, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Apr 01, 2013
    Quiz Created by
    Moxleyv

Related Topics

Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.