SAS STUDY GUIDE

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Which statement is true concerning the execution phase of the DATA step? a.Data is processed in the program data vector (PDV). b.An implied OUTPUT occurs at the top of the DATA step. c.An implied REINITIALIZE occurs at the bottom of the DATA step. d.Columns read from the input table are set to missing when SAS returns to the top of the DATA step.

A. Data is processed in the program data vector (PDV).

Which statement is false concerning the compilation phase of the DATA step? a.Initial values are assigned to the columns. b.The program data vector (PDV) is created. c.The DATA step is checked for syntax errors. d.The descriptor portion of the output table is created.

A. Initial values are assigned to the columns.

/* Report created for budget presentation; revised October 15. */ proc print data=work.newloan; run; Does this comment contain syntax errors? a.No. The comment is correctly specified. b.Yes. Every comment line must end with a semicolon. c.Yes. The comment is on more than one line. Yes. There is a semicolon in the middle of the comment

A. No, the comment is correctly specified

Which of the following steps is typically used to generate reports and graphs? a.DATA b.PROC c.REPORT d.RUN

A. PROC

Which statement is false? a.The KEEP statement names the columns to include from the input table. b.The DROP statement names the columns to exclude from the output table. c.The KEEP= option in the DATA statement names the columns to include in the output table. d.The DROP= option in the SET statement names the columns to exclude from being read into the PDV.

A. The Keep statement names the columns to include from the input table

Use a DO group in a DATA step when you want to execute multiple statements for a true IF-THEN expression. a.True b.False

A. True

10.In which portion of a SAS table are the following found? •name of the table •type of the column Salary •creation date of the table a.descriptor portion b.data portion

A. descriptor portion

Which LIBNAME statement has the correct syntax? a. libname reports "filepath/workshop"; b. libname orion filepath/workshop; c. libname 3456a "filepath/workshop";

A.The libref must start with a letter or an underscore and contain eight characters maximum. The path must also be in quotation marks.

proc print data=work.newsalesemps run; What result would you expect from submitting this step? a.a report of the work.newsalesemps data set b.an error message in the log c.the creation of a table named work.newsalesemps

B. An error in the log

Functions and CALL routines both return a value that must be used in an assignment statement or expression. a.True b.False

B. False

The DATA step debugger in SAS Enterprise Guide can be used with DATA and PROC steps. a.True b.False

B. False

data national; set sashelp.baseball; BatAvg=nHits/nAtBat; run; proc means data=NATIONAL; var BatAvg; run; 9.This program contains a syntax error because National is in different cases. a.True b.False

B. False

10.Which of the following is not a SAS programming interface? a.SAS Enterprise Guide b.SAS Manager c.SAS Studio d.SAS windowing environment

B. SAS Manager

data work.boots(drop=Product); set sashelp.shoes(keep=Product Subsidiary Sales Inventory); where Product='Boot'; drop Sales Inventory; Total=sum(Sales,Inventory); run; Which columns are in the final table work.boots? a. Subsidiary b. Subsidiary and Total c. Product and Subsidiary d. Product, Subsidiary, Sales, and Inventory

B. Subsidiary and Total

In this PROC CONTENTS output, what is the default length of the Birth_Date column?

Birth_Date is a numeric column, and all numeric columns in SAS are 8 bytes by default.

Which statement is not a compile-time-only statement? a.KEEP b.LENGTH c.SET d.WHERE

C. Set

What statement is used to read a SAS data set in a DATA step? a.DATA statement b.WHERE statement c.SET statement d.assignment statement

C. Set Statement

*Create a cars report; title "European Cars Priced Over 30K"; footnote "Internal Use Only"; proc print data=sashelp.cars; where Origin='Europe' and MSRP>30000; var Make Model Type Mpg_City Mpg_Highway; run; How many statements does this program contain? a.five b.six c.seven d.eight

C. Seven

Which expression rounds each value of Sales to the nearest hundredth (or two decimal places)? a.round(Sales) b.round(Sales, 2) c.round(Sales, .01) d.round(Sales, dollar10.2)

C. round(Sales, .01)

Which of the following tables is available at the beginning of a new SAS session? a. sales b. work.newsalesemps c. sashelp.class

C. sashelp.class

1.In which phase does the DATA step check for syntax errors? a.compilation b.execution

Compilation

Running a SAS program can create which of the following? a.log b.output data c.results d.all of the above

D. All of the above

Which of the following is a SAS syntax requirement? a.Begin each statement in column one. b.Put only one statement on each line. c.Separate each step with a line space. d.End each statement with a semicolon.

D. End each statement with a semicolon

Which function calculates the average of the columns Week1, Week2, Week3, and Week4? a.mean(Week1, Week4) b.mean(Week1-Week4) c.mean(of Week1, Week4) d.mean(of Week1-Week4)

D. mean(of Week1-Week4)

Name=Alfred Height=69 Weight=112.5 Ratio=0.61 _ERROR_=0 _N_=1 Ratio=0.61 5.Which PUTLOG statements create the following results in the SAS log? a. putlog all; putlog Ratio; b. putlog all; putlog Ratio=; c. putlog _all_; putlog Ratio; d. putlog _all_; putlog Ratio=;

D. putlog _all_ ; putlog Ratio=;

Which statement contains valid syntax for the RETAIN statement? a. retain year 2018; b. retain year*2018; c. retain year=2018; d. retain year{2018};

a Year is the column to retain with an initial value of 2018. A space goes between the retain column and the initial value.

Which statement about SAS dates is false? a.A SAS date is one of three of SAS column types: numeric, character, and date. b.SAS dates represent the number of days from January 1, 1960. c.SAS date values can be positive or negative. d.SAS date values can be used in calculations.

a.A SAS date is one of three of SAS column types: numeric, character, and date.

Which of the following functions can convert the values of the numeric variable Level to character values? a.put(Level, 3.) b.put(3., Level) c.input(3., Level) d.input(Level, 3.)

a.put(Level, 3.)

Which statement is false concerning the sum statement? a.The sum statement ignores missing values. b.The sum statement initially sets the accumulator column to missing. c.The sum statements adds a numeric value to an accumulator column. d.The sum statement automatically retains the value of the accumulating column.

b The SUM statement ignores missing values, initially sets the accumulator column to 0

In the FORMAT procedure, you specify the name of the format and the name of the column that will use the custom format. a.True b.False

b The format name is specified in the VALUE statement of PROC FORMAT

proc import datafile="d:/collect817/bird_count.csv" dbms=csv out=bird817 replace; run; What does this code do? a.It creates a SAS table named Bird817 in the Work library from the CSV file bird_count and replaces Bird817 whenever the CSV file is updated. b.It creates a SAS table named Bird817 in the Work library from the CSV file bird_count. c.It uses the CSV engine to directly read the data file bird_count.csv.

b This PROC IMPORT step creates a SAS table from a CSV file. When the code runs, it replaces the SAS table if it already exists.

Which of the following is a valid name for a character format? a.country b.$ctry c.$country. d._country

b) Character formats must start with a dollar sign followed by a letter or underscore. A format name does not end with a period.

8.To disassociate a libref that you previously assigned, you can use the UNASSIGN option in the LIBNAME statement. a.True b.False

b) Use the CLEAR option in the LIBNAME statement to disassociate an assigned libref.

porc print data=work.newsalesemps; run; 8.What happens if you submit the following program? a.SAS does not execute the step. b.SAS assumes that PROC is misspelled and executes the step.

b.SAS assumes that PROC is misspelled and executes the step.

Which statement reads CityCountry and correctly assigns a value to Country? a.Country=scan(CityCountry, 2); b.Country=scan(CityCountry, -1); c.Country=scan(CityCountry, 2, ','); d.Country=scan(CityCountry, 2, ', ');

c The SCAN function should return the second word using only the comma as a delimiter.

Which library name (libref) is valid? a. 2010Car b. car/2010 c. car2010 d. cars_2010

c) This libref follows all three rules for valid librefs. A libref must have a length of one to eight characters, and must begin with a letter or underscore. The remaining characters must be letters, numbers, or underscores.

data national; set sashelp.baseball; BatAvg=nHits/nAtBat; run; proc contents data=national; run; proc print data=national; run; proc means data=national; var BatAvg; run; How many steps does this program contain? a. one b. two c. four d. eight

c. Four

Which expression creates CityCountry? a.cat(City, ", ", Country) b.cats(", ", City, Country) c.catx(City, ", ", Country) d.catx(", ", City, Country)

d The CATX function concatenates strings together, removes leading and training blanks, and inserts the separator that is defined as the first argument.

Which of the following statements selects from a table only those rows where the value of the Style column is RANCH, SPLIT, or TWOSTORY? a. where Style='RANCH' or 'SPLIT' or 'TWOSTORY'; b. where Style in 'RANCH' or 'SPLIT' or 'TWOSTORY'; c. where Style in (RANCH, SPLIT, TWOSTORY); d. where Style in ('RANCH', 'SPLIT', 'TWOSTORY');

where Style in ('RANCH', 'SPLIT', 'TWOSTORY');


Kaugnay na mga set ng pag-aaral

NCLEX Psychosocial Alterations (Mod 4)

View Set

American Gov - Test 3 Presidency and Federal Admin

View Set

Exam 261: Contact Center Analytics (5%)

View Set

Episode 11: How to Train a Brain

View Set

Child with an integumentary disorder

View Set