SAS Chapter 2 Referencing Files And Setting Options

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: 20,578
Questions: 10 | Attempts: 482

SettingsSettingsSettings
SAS Chapter 2 Referencing Files And Setting Options - Quiz

Practice for the SAS basic certification exam


Questions and Answers
  • 1. 

    If you submit the following program, how does the output look? options pagesize=55 nonumber; proc tabulate data=clinic.admit;      class actlevel;      var age height weight;     table actlevel,(age height weight)*mean; run; options linesize=80; proc means data=clinic.heart min max maxdec=1;      var arterial heart cardiac urinary;      class survive sex; run;

    • A.

      The PROC MEANS output has a print line width of 80 characters, but the PROC TABULATE output has no print line width.

    • B.

      The PROC TABULATE output has no page numbers, but the PROC MEANS output has page numbers.

    • C.

      Each page of output from both PROC steps is 55 lines long and has no page numbers, and the PROC MEANS output has a print line width of 80 characters,

    • D.

      The date does not appear on output from either PROC step.

    Correct Answer
    C. Each page of output from both PROC steps is 55 lines long and has no page numbers, and the PROC MEANS output has a print line width of 80 characters,
    Explanation
    When you specify a system option, it remains in effect until you change the option or end your SAS session, so both PROC steps generate output that is printed 55 lines per page with no page numbers. If you don't specify a system option, SAS uses the default value for that system option.

    Rate this question:

  • 2. 

    How can you create SAS output in HTML format on any SAS platform?

    • A.

      By specifying system options

    • B.

      By using programming statements

    • C.

      By using SAS windows to specify the result format

    • D.

      You can't create HTML output on all SAS platforms

    Correct Answer
    B. By using programming statements
    Explanation
    You can create HTML output using programming statements on any SAS platform. In addition, on all except mainframe platforms, you can use SAS windows to specify HTML as a result format.

    Rate this question:

  • 3. 

    In order for the date values 05May1955 and 04Mar2046 to be read correctly, what value must the YEARCUTOFF= option have?

    • A.

      A value between 1947 and 1954, inclusive

    • B.

      1955 or higher

    • C.

      1946 or higher

    • D.

      Any value

    Correct Answer
    D. Any value
    Explanation
    As long as you specify an informat with the correct field width for reading the entire date value, the YEARCUTOFF= option doesn't affect date values that have four-digit years.

    Rate this question:

  • 4. 

    When you specify an engine for a library, you are always specifying

    • A.

      The file format for files that are stored in the library.

    • B.

      The version of SAS that you are using.

    • C.

      Access to other software vendors' files.

    • D.

      Instructions for creating temporary SAS files.

    Correct Answer
    A. The file format for files that are stored in the library.
    Explanation
    A SAS engine is a set of internal instructions that SAS uses for writing to and reading from files in a SAS library. Each engine specifies the file format for files that are stored in the library, which in turn enables SAS to access files with a particular format. Some engines access SAS files, and other engines support access to other vendors' files.

    Rate this question:

  • 5. 

    Which statement prints a summary of all the files stored in the library named Area51?

    • A.

      Proc contents data=area51._all_ nods;

    • B.

      Proc contents data=area51 _all_ nods;

    • C.

      Proc contents data=area51 _all_ nods;

    • D.

      Proc contents data=area51 _all_.nods;

    Correct Answer
    A. Proc contents data=area51._all_ nods;
    Explanation
    To print a summary of library contents with the CONTENTS procedure, use a period to append the _ALL_ option to the libref. Adding the NODS option suppresses detailed information about the files.

    Rate this question:

  • 6. 

    The following PROC Print output was created immediately after PROC TABULATE output.  Which system options were specified when the report was created?

    • A.

      OBS=, DATE, and NONUMBER

    • B.

      NUMBER, PAGENO=1, and DATE

    • C.

      NUMBER and DATE only

    • D.

      None of the above

    Correct Answer
    B. NUMBER, PAGENO=1, and DATE
    Explanation
    Clearly, the DATE and NUMBER(page number) options are specified. Because the page number on the output is 1, even though the PROC TABULATE output was just produced, PAGENO=1 must also have been specifed. If you don't specify PAGENO=, all output in the Output window is numbered sequentially throughout your SAS session.

    Rate this question:

  • 7. 

    Which of the following programs correctly references a SAS data set named SalesAnalysis that is stored in a permanent SAS library?

    • A.

      Data saleslibrary.salesanalysis; set mydata.quarter1sales; if sales>1000000; run;

    • B.

      Data mysales.totals; set sales_99.salesanalysis; if totalsales>50000; run;

    • C.

      Aproc print data=salesanalysis.quarter1; var sales salesrep month; run;

    • D.

      Proc freq data=1999data.salesanalysis; tables quarter*sales; run;

    Correct Answer
    B. Data mysales.totals; set sales_99.salesanalysis; if totalsales>50000; run;
    Explanation
    Librefs must be 1 to 8 characters long, must begin with a letter or underscore and can contain only letters, numbers, or underscores. After you assign a libref, you specify it as the first element in the two-level name for a SAS file.

    Rate this question:

  • 8. 

    Which time span is used to interpret the two-digit year values if the YEARCUTOFF= option is set to 1950?

    • A.

      1950-2049

    • B.

      1950-2050

    • C.

      1949-2050

    • D.

      1950-2000

    Correct Answer
    A. 1950-2049
    Explanation
    The YEARCUTOFF= option specifies which 100-year span is used to interpret two-digit year values. The default value of YEARCUTOFF= to the first year of another 100-year span. If you specify YEARCUTOFF= 1950, then the 100-year span will be from 1950 to 2049.

    Rate this question:

  • 9. 

    Assuming you are using SAS code and not special SAS windows, which one of the following statements is false?

    • A.

      LIBNAME statements can be stored with a SAS program to reference the SAS library automatically when you submit the program.

    • B.

      When you delete a libref, SAS no longer has access to the files in the library. However, the contents of the library still exist on your operating system.

    • C.

      Librefs can last from one SAS session to another.

    • D.

      You can access files that were created with other vendors' software by submitting a LIBNAME statement.

    Correct Answer
    C. Librefs can last from one SAS session to another.
    Explanation
    The LIBNAME statement is global, ehich means that librefs remain in effect until you modify them, cancel them, or end your SAS session. Therefore, the LIBNAME statement assigns the libref for the current SAS session only. You must assign a libref before accessing SAS files that are stored in a permanent SAS data library.

    Rate this question:

  • 10. 

    What does the following statement do? libname osiris spss 'c:\myfiles\sasdata\data';

    • A.

      Defines a library called Spss using the OSIRIS engine

    • B.

      Defines a library called Osiris using the SPSS engine

    • C.

      Defines two libraries called Osiris and Spss using the default engine

    • D.

      Defines the default library using OSIRIS and SPSS engines

    Correct Answer
    B. Defines a library called Osiris using the SPSS engine
    Explanation
    In the LIBNAME statement, you specify the library name before the engine name. Both are followed by the path.

    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 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jan 09, 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.