work.test temp.test sasuser.test test

Similar documents
DSCI 325 Practice Midterm Questions Spring In SAS, a statement must end

STATION

SAS Institue EXAM A SAS Base Programming for SAS 9

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

Chapter 1 The DATA Step

DSCI 325: Handout 10 Summarizing Numerical and Categorical Data in SAS Spring 2017

DSCI 325: Handout 9 Sorting and Options for Printing Data in SAS Spring 2017

SAS Online Training: Course contents: Agenda:

MATH 707-ST: Introduction to Statistical Computing with SAS and R. MID-TERM EXAM (Writing part) Fall, (Time allowed: TWO Hours)

STAT:5400 Computing in Statistics

Name: Batch timing: Date: The SAS data set named WORK.SALARY contains 10 observations for each department, currently ordered by DEPARTMENT.

Introduction to the SAS Macro Facility

A SAS Macro for Producing Benchmarks for Interpreting School Effect Sizes

INTRODUCTION TO SAS HOW SAS WORKS READING RAW DATA INTO SAS

USING SAS SOFTWARE TO COMPARE STRINGS OF VOLSERS IN A JCL JOB AND A TSO CLIST

Contents. About This Book...1

SAS Certification Handout #10: Adv. Prog. Ch. 5-8

BASICS BEFORE STARTING SAS DATAWAREHOSING Concepts What is ETL ETL Concepts What is OLAP SAS. What is SAS History of SAS Modules available SAS

Efficiently Join a SAS Data Set with External Database Tables

Vendor: SAS Institute. Exam Code: A Exam Name: SAS Advanced Programming Exam for SAS 9. Version: Demo

Base and Advance SAS

Biostatistics & SAS programming. Kevin Zhang

10 The First Steps 4 Chapter 2

STAT 7000: Experimental Statistics I

Sample Questions. SAS Advanced Programming for SAS 9. Question 1. Question 2

Objectives. After completing this lesson, you should be able to do the following:

Using SAS Files CHAPTER 3

Basic Concept Review

T.I.P.S. (Techniques and Information for Programming in SAS )

TOP 10 (OR MORE) WAYS TO OPTIMIZE YOUR SAS CODE

SASInstitute A SAS Base Programming. Download Full Version :

Contents of SAS Programming Techniques

Sandra Hendren Health Data Institute

APPENDIX 4 Migrating from QMF to SAS/ ASSIST Software. Each of these steps can be executed independently.

SAS Institute Exam A SAS Advanced Programming Version: 6.0 [ Total Questions: 184 ]

DSCI 325: Handout 15 Introduction to SAS Macro Programming Spring 2017

Submitting SAS Code On The Side

16. Reading raw data in fixed fields. GIORGIO RUSSOLILLO - Cours de prépara)on à la cer)fica)on SAS «Base Programming» 364

Report Writing, SAS/GRAPH Creation, and Output Verification using SAS/ASSIST Matthew J. Becker, ST TPROBE, inc., Ann Arbor, MI

DATA Step Debugger APPENDIX 3

Exam Name: SAS Base Programming for SAS 9

What Is SAS? CHAPTER 1 Essential Concepts of Base SAS Software

ABSTRACT INTRODUCTION MACRO. Paper RF

AURA ACADEMY SAS TRAINING. Opposite Hanuman Temple, Srinivasa Nagar East, Ameerpet,Hyderabad Page 1

INTRODUCTION TO PROC SQL JEFF SIMPSON SYSTEMS ENGINEER

Planting Your Rows: Using SAS Formats to Make the Generation of Zero- Filled Rows in Tables Less Thorny

IT 433 Final Exam. June 9, 2014

MANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9)

Introduction to PROC SQL

Top 5 Handy PROC SQL Tips You Didn t Think Were Possible

DSCI 325: Handout 2 Getting Data into SAS Spring 2017

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

Lecture 1 Getting Started with SAS

DUE: 9. Create a query that will return the average order total for all Global Fast Foods orders from January 1, 2002, to December 21, 2002.

RESTRICTING AND SORTING DATA

Formats and the Format Procedure

Using SAS Files CHAPTER 3

Create a SAS Program to create the following files from the PREC2 sas data set created in LAB2.

Unit 1 - Chapter 4,5

Turn In: A copy of the first 50 lines or so of the converted text file.

Using the Set Operators. Copyright 2004, Oracle. All rights reserved.

Chapter 2: Getting Data Into SAS

INFORMATICS PRACTICES

Database Programming with SQL

Validation Summary using SYSINFO

Electricity Forecasting Full Circle

Advanced SQL Processing Prepared by Destiny Corporation

SAS Data Libraries. Objectives. Airline Data Library. SAS Data Libraries. SAS Data Libraries FILES LIBRARIES

SAS Graphics & Code. stat 480 Heike Hofmann

Writing Programs in SAS Data I/O in SAS

Getting Your Data into SAS The Basics. Math 3210 Dr. Zeng Department of Mathematics California State University, Bakersfield

ICD_CLASS SAS Software User s Guide. Version FY Prepared for: U.S. Centers for Disease Control and Prevention

CS 209 Spring, 2006 Lab 8: GUI Development Instructor: J.G. Neal

Structure Query Language (SQL)

From Manual to Automatic with Overdrive - Using SAS to Automate Report Generation Faron Kincheloe, Baylor University, Waco, TX

Taming a Spreadsheet Importation Monster

An Introduction to SAS Macros

The GEOCODE Procedure and SAS Visual Analytics

Reading data in SAS and Descriptive Statistics

Processing SAS Data Sets

An Introduction to SAS/FSP Software Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California

OASUS Spring 2014 Questions and Answers

Hidden in plain sight: my top ten underpublicized enhancements in SAS Versions 9.2 and 9.3

Full file at

School of Computing and Information Technology. Examination Paper Autumn Session 2017

SAS CURRICULUM. BASE SAS Introduction

An Introduction to Visit Window Challenges and Solutions

SAS coding for those who like to be control

INTRODUCTION to SAS STATISTICAL PACKAGE LAB 3

Using an ICPSR set-up file to create a SAS dataset

CSE 565 Computer Security Fall 2018

SAS 101. Based on Learning SAS by Example: A Programmer s Guide Chapter 21, 22, & 23. By Tasha Chapman, Oregon Health Authority

Using Dynamic Data Exchange

ACCESS Procedure Reference

CHAPTER 7 Using Other SAS Software Products

Exam Name: SAS Base Programming for SAS (r) 9 Exam Type: SAS Exam Code: A Total Questions: 127

Introduction to SAS Statistical Package

David Beam, Systems Seminar Consultants, Inc., Madison, WI

Test Bank for Database Processing Fundamentals Design and Implementation 13th Edition by Kroenke

SQL Structured Query Language Introduction

Transcription:

DSCI 325 Midterm Practice Test Spring 2017 Name: 1. Consider the following four names used to create a SAS data set: work.test temp.test sasuser.test test How many of these will be stored as permanent data sets? a. None b. One c. Two d. Three 2. The SAS informat 4. indicates the variable should be stored as a. A monetary value having field width 4 b. A numeric value to 4 decimal places c. A numeric variable with width 4 d. A character value with width 4 3. Consider the code below. DATA Classes; INPUT Subject $ CourseNum $ Enrollment; DATALINES; STAT 325 9 MATH 100 37 STAT 21 41 ; PROC CONTENTS; In which SAS library will the output data set Classes be stored? a. The WORK library. b. The SASUSER library. c. The TEMP library. d. The data set will not be stored in any SAS library since no library was specified in the program. 4. Consider the following program. DATA test; INFILE 'Desktop/test.dat'; INPUT var1 var2 +3 var3; What does the +3 do? 1

a. It moves the pointer down to the third row of the data file (i.e., to the third observation in the data set). b. It moves the column pointer to column 3. c. It adds 3 to the value read into var2. d. It advances the column pointer 3 places. Questions 5-6 refer to the following data sets, Work.One and Work.Two. Work.One Work.Two 5. Suppose the following programming statements are submitted (note that both data sets are already sorted by Id). DATA Work.Both; MERGE Work.One Work.Two; BY Id; Which of the following is the correct data set Work.Both? a. c. b. d. 2

6. Suppose the following programming statements are submitted. DATA Work.Both; SET Work.One Work.Two; Which of the following is the correct data set Work.Both? a. c. b. d. 7. The NationalParks data set contains four variables: Park_Name, Region, Museums, and Camping. Suppose the following SAS program is submitted. PROC MEANS DATA = Hooks.NationalParks MEAN; <insert statement(s) here> The following report is produced: Which of the following contains the missing statement(s) needed to produce this report? a. CLASS Region; b. VAR Museums Camping; c. CLASS Region; VAR Museums Camping; d. VAR Region; CLASS Museums Camping; 3

8. The following SAS program is submitted: DATA WORK.TEMP; Char1='0123456789'; Char2=SUBSTR(Char1,3,4); What is the value of Char2? a. 23 b. 34 c. 345 d. 2345 9. The following SAS program is submitted: DATA WORK.TEMP; Char1='0123456789'; Char2=FIND(Char1,'3', 5); What is the value of Char2? a. 0 b. 4 c. 6 d. 34567 e. 23456 10. Suppose the following statements were submitted to SAS. %MACRO PrintData(Dataset = ); PROC PRINT DATA = &Dataset; %MEND PrintData; %PrintData(Dataset = Hooks.Grades); Which of the following statements is most correct? a. This code will not produce any output because a %LET statement was never used to define the value of the macro variable Dataset. b. This code will not produce any output because the last statement should have been written as follows to correctly invoke the macro: %PrintData(Dataset = &Hooks.Grades); c. This code will print the data set named Hooks.Grades. d. This code will print the data set named Dataset. 4

11. Consider the following code which is used to merge two data sets named A and B. Write the appropriate IF statement to create the desired data set containing only the matches (i.e., the observations that were in both of the original data sets). DATA AB; MERGE A(in=InA) B(in=InB); BY ID; 12. Consider the following program. DATA Work.Salary; INPUT Name $ MStatus $ Salary $ ; DATALINES; Mary S 45600 Scott M 46200 Tanya M 52150 Tim M 48400 ; PROC PRINT DATA=Salary; WHERE Salary > 50000; When this code was submitted, no output was produced. The Log window displayed the following. 5

a. Explain why the Work.Salary dataset was not successfully created in SAS. b. Rewrite the INPUT statement so that the data set is successfully created. INPUT 6

13. Consider the following code which is used to calculate summary statistics for only the year specified with a macro variable. Finish the WHERE statement to produce the desired output for any given year specified by the user in the %LET statement. %LET Year = 2014; PROC MEANS DATA = MN_precip N Q1 MEDIAN Q3 MEAN STD; VAR precip; WHERE 14. Now, suppose a title statement is added to the above code as follows. %LET Year = 2014; TITLE 'Year = &Year'; PROC MEANS DATA=precip2 N Q1 MEDIAN Q3 MEAN STD; VAR precip; When the program is resubmitted, the following output is obtained. Note that your title is incorrect: it should specify that the output is relevant to the year 2014. Fix the TITLE statement so that the correct title is displayed for any given year specified by the user in the %LET statement. TITLE 7

15. Suppose the director of sales wants a report generated for all employees that report directly to him. The data for all employees in the company is contained in the file HR.EmployeeInfo. There is a variable in this data set named Department that takes on the value Sales for all employees that report to this director of sales. Finish both the SELECT clause and the FROM clause below to query all variables in this file for only the employees that report to this director. (4 pts) PROC SQL; SELECT FROM QUIT; 16. Consider the previous problem. This time, suppose the director has requested that the report contain information on only the following variables from the HR.EmployeeInfo data set: Employee_ID, Job_Title, and Salary. Furthermore, he wants the variables Employee_ID and Job_Title to be labeled Employee ID and Job Title in the final report (i.e., he doesn t want the underscores to appear). He still wants the report to contain information on only employees that report to him. Modify your PROC SQL statements from above to obtain the query the director has requested. (5 pts) PROC SQL; SELECT FROM QUIT; 8

17. Once again, consider the scenario presented in problem 9. This time, suppose the director has requested that you calculate the Number of employees in the Sales Department and the Average Salary of the employees in the Sales Department. These columns should be labeled Count and Average Salary in the report you prepare. Write PROC SQL statements to obtain the output the director has requested. (5 pts) PROC SQL; SELECT FROM QUIT; 9