Sas certification Part 1 Lesson 1

¡Supera tus tareas y exámenes ahora con Quizwiz!

How many statements are in this proc step? proc means data=myclass; var age heightcm; run;

3 statements: Proc statement, var statement, and run statement

What can a DATA step do?

A DATA step generally reads data from an input source, processes it, and creates a SAS table. A DATA step might also filter rows, compute new columns, join tables, and perform other data manipulations. In this program, the DATA step is creating an output table and adding a new column.

What can a PROC step do?

A PROC, or procedure, step processes a SAS table in a specific, predefined way. SAS has dozens of procedures that generate reports and graphs, manage data, or perform complex statistical analyses.

What do all statements need to end with?

A SEMICOLON

What is wrong with code: title "Average MPG by Car Type"; proc means data=mycars average min max maxdec=1; var avgmpg; class type; run; title;

In the proc means statement "average" will not run and it should be "mean"

run, proc, quit

Most steps end with a _____ statement, and a few ____ steps end with a ______ statement.

PROC MEANS can:

PROC MEANS step calculates basic summary statistics

PROC PRINT can:

PROC PRINT step generates a list of all the rows and columns in the data

Global statements are outside steps. What are some global statements?

TITLE ... ; OPTIONS ... ; LIBNAME ... ;

What is wrong with this code: title "Cars with Average MPG Over 35"; proc print data=mycars var make model type avgmpg; where AvgMPG > 35; run;

There is a semicolon missing after "proc print data=mycars"

True or false: A SAS program can contain any combination of DATA steps and PROC steps depending on the tasks you want to perform.

True

True or false: SAS programs consist of DATA and PROC steps, and each step consists of statements.

True

True or false: You can type unquoted values, such as columns, table names, or keywords in any case.

True

5. Does this comment contain syntax errors? /* Report created for budget presentation; revised October 15. */ proc print data=work.newloan; run; 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. d. Yes. There is a semicolon in the middle of the comment.

a. No. The comment is correctly specified.

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

b. False. Case does not matter in unquoted values, so in this case, the data set name can be specified in any case.

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

b. PROC

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

7. What happens if you submit the following program? porc print data=work.newsalesemps; run; 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.

6. What result would you expect from submitting this step? proc print data=work.newsalesemps run; 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 message in the log. There is a missing semicolon following the data set name. When this step runs, SAS will interpret the word run as an option in the PROC PRINT statement (because of the missing semicolon). As a result, the PROC PRINT step will not execute and an error message will be displayed in the log.

1. How many steps does this program contain? 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; a. one b. two c. four d. eight

c. four

9. How many statements does this program contain? *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; a. five b. six c. seven d. eight

c. seven. This program contains seven statements (seven semicolons): comment, TITLE, FOOTNOTE, PROC, WHERE (two lines), VAR (two lines), and RUN.

3. 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.

2. 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

Whats wrong with this code: daat mycars; set sashelp.cars; AvgMPG=mean(mpg_city, mpg_highway); run;

data is mispelled


Conjuntos de estudio relacionados

Chapter 4- Medical Abbreviations

View Set

Listen and circle the false word and write the correct word

View Set

DMS 209 Review Book Chapter 1 Questions

View Set

Exam 2: CH. 17 and Ch. 66 (mechanical ventilation, endotracheal intubation, and ABGs)

View Set

Evolve: Maternity - Women's Health/Disorders

View Set

Fundamental HESI, Hesi Fundamentals, Hesi Fundamentals Practice Test, UNIT 1: Foundations of Nursing Practice

View Set

Oklahoma Life and Health Exam Study Guide Part 3

View Set

The Client with Cancer of the Bladder

View Set

NCLEX Child Health- Renal and Urinary

View Set

Religion Chapter 6-Abraham is Our Father in Faith

View Set