SAS Chapter 5

10 Questions | Attempts: 559
Share
Please wait...
Question 1 / 10
0 %
0/100
Score 0/100
1. Which SAS statement subsets the raw data shown below so that only the observations in which Sex (in the second field) has a value of F are processed?

Explanation

To subset data, you can sue a subsetting IF statement in any DATA step to process only those observations that meet a specified condition. Because Sex is a character variable, the value F must be enclosed in quotation marks and must be in the same case as the data set.

Submit
Please wait...
About This Quiz
SAS Chapter 5 - Quiz

Practice for the basic SAS certification exam.

Tell us your name to personalize your report, certificate & get on the leaderboard!
2. Which program creates the output shown below?

Explanation

The INPUT statement creates a variable using the name that you assign to each field. Therefore, when you write an INPUT statement, you need to specify the variable names exactly as you want them to appear in the SAS data set.

Submit
3. Which SAS statement associates the fileref Crime with the raw data file C:\States\Data\Crime?

Explanation

Before you can read your raw data, you must reference the raw data file by creating a fileref. You assign a fileref by using a FILENAME statement in the same way that you assign a libref by using a LIBNAME statement.

Submit
4. Filerefs remain in effect until...

Explanation

Like LIBNAME statements, FILENAME statements are global; they remain in effect until you change them, cancel them, or end your SAS session.

Submit
5. Which statement identifies the name of a raw data file to be read with the fileref Products and specifies that the DATA step read only records 1-15?

Explanation

You use an INFILE statement to specify the raw data file to be read. You can specify a fileref or an actual filename (in quotation marks). The OBS=option in the INFILE statement enables you to process only records 1 through n.

Submit
6. Which statement correctly re-defines the values of the variable Income as 100 percent higher?

Explanation

To re-define the values of the variable Income in an assignment statement, you specify the variable name on the left side of the equal sign and an appropriate expression including the variable name on the right side of the equal sign.

Submit
7. Which raw data file can be read using column input?

Explanation

Column input is appropriate only in some situations. When you use column input, your data must be standard character or numeric values, and they must be in fixed fields. That is, values for a particular variable must be in the same location in all records.

Submit
8. Which program correctly reads instream data;

Explanation

To read instream data, you specify a DATALINES statement and data lines, followed by a null statement (single semicolon) to indicate the end of the input data. Program a contains no DATALINES statement, and the INPUT statement doesn't specify the fields to read. Program b contains no data lines, and the INPUT statement in program c doesn't specify the necessary dollar signs for the character variables Country and Vehicle.

Submit
9. Which of the following programs correctly writes the observations from the data set below to a raw data file?

Explanation

The keyword _NULL_ in the DATA statement enables you to use the power of the DATA step without actually creating a SAS data set. You use the FILE and PUT statements to write out the observations from a SAS data set to a raw data file. The FILE statement specifies the raw data file and the PUT statement descrives the lines to write to the raw data file. The filename and location specified in the FILE statement must be enclosed in quotation marks.

Submit
10. Which statement correctly reads the fields in the following order: Stock Number, Price Item, Finish, Style?

Explanation

You can use column input to read fields in any order. You must specify the variable name to be created, identify character values with a $, and name the correct starting column and ending column for each field.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 19, 2022 +

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

  • Current Version
  • Mar 19, 2022
    Quiz Edited by
    ProProfs Editorial Team
  • Jan 17, 2013
    Quiz Created by
    Moxleyv
Cancel
  • All
    All (10)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Which SAS statement subsets the raw data shown below so that only the...
Which program creates the output shown below?
Which SAS statement associates the fileref Crime with the raw data...
Filerefs remain in effect until...
Which statement identifies the name of a raw data file to be read with...
Which statement correctly re-defines the values of the variable Income...
Which raw data file can be read using column input?
Which program correctly reads instream data;
Which of the following programs correctly writes the observations from...
Which statement correctly reads the fields in the following order:...
Alert!

Advertisement