Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

Fundamentals of programming in sas a case studies approach

27/10/2021 Client: muhammad11 Deadline: 2 Day

St 555 Homework2 Coding 1 Page

The correct bibliographic citation for this manual is as follows: Blum, James and Jonathan

Duggins. 2019. Fundamentals of Programming in SAS®: A Case Studies Approach. Cary, NC: SAS Institute Inc.

Fundamentals of Programming in SAS®: A Case Studies Approach

Copyright © 2019, SAS Institute Inc., Cary, NC, USA

978­1­64295­228­5 (Hardcover) 978­1­63526­672­6 (Paperback) 978­1­63526­671­9 (Web PDF) 978­1­63526­669­6 (epub) 978­1­63526­670­2 (mobi)

All Rights Reserved. Produced in the United States of America.

For a hard­copy book: No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, SAS Institute Inc.

For a web download or e­book: Your use of this publication shall be governed by the terms established by the vendor at the time you acquire this publication.

The scanning, uploading, and distribution of this book via the Internet or any other means without the permission of the publisher is illegal and punishable by law. Please purchase only authorized electronic editions and do not participate in or encourage electronic piracy of copyrighted materials. Your support of others’ rights is appreciated.

U.S. Government License Rights; Restricted Rights: The Software and its documentation is commercial computer software developed at private expense and is provided with RESTRICTED RIGHTS to the United States Government. Use, duplication, or disclosure of the Software by the United States Government is subject to the license terms of this Agreement pursuant to, as applicable, FAR 12.212, DFAR 227.7202­ 1(a), DFAR 227.7202­3(a), and DFAR 227.7202­4, and, to the extent required under U.S. federal law, the minimum restricted rights as set out in FAR 52.227­19 (DEC 2007). If FAR

Playlists

History

Topics

Learning Paths

Offers & Deals

Highlights

Settings

Support

Sign Out

52.227­19 is applicable, this provision serves as notice under clause (c) thereof and no other notice is required to be affixed to the Software or documentation. The Government’s rights in Software and documentation shall be only those set forth in this Agreement.

SAS Institute Inc., SAS Campus Drive, Cary, NC 27513­2414

July 2019

SAS® and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.

Other brand and product names are trademarks of their respective companies.

SAS software may be provided with certain third­party software, including but not limited to open­source software, which is licensed under its applicable third­party software license agreement. For license information about third­party software distributed with SAS software, refer to http://support.sas.com/thirdpartylicenses.

Chapter 1: Introduction to SAS

1.1 Introduction

1.2 Learning Objectives

1.3 SAS Environments

1.3.1 The SAS Windowing Environment

1.3.2 SAS Studio and SAS University Edition

1.4 SAS Fundamentals

1.4.1 SAS Language Basics

1.4.2 SAS DATA and PROC Steps

1.4.3 SAS Libraries and Data Sets

1.4.4 The SAS Log

1.5 Output Delivery System

1.6 SAS Language Basics

1.6.1 SAS Language Structure

1.6.2 SAS Naming Conventions

1.7 Chapter Notes

1.8 Exercises

1.1 Introduction

This chapter introduces basic concepts about SAS that are necessary to use it effectively. This

chapter begins with an introduction to some of the available SAS environments and describes

Playlists

History

Topics

Learning Paths

Offers & Deals

Highlights

Settings

Support

Sign Out

the basic functionality of each. Essentials of coding in SAS are also introduced through some

pre‐constructed sample programs. These programs rely on several data sets, some provided

with SAS, others are provided separately with the textbook, including those that form the basis

for the case study used throughout Chapters 2 through 7. Therefore, this chapter also

introduces SAS data sets and libraries. In addition, an introduction to debugging code is

included, which includes a discussion of the SAS log where notes, warnings, and error

messages are provided for any code submitted.

1.2 Learning Objectives

This chapter provides a basis for working in SAS, which is a necessary first step for successful

mastery of the material contained in the remainder of this book. In detail, it is expected upon

completion of this chapter that the following concepts are understood within the chosen SAS

environment:

Demonstrate the ability to open, edit, save, and submit a SAS program

Apply the LIBNAME statement to create a user‐defined library—including the BookData

library that contains all files for this text, downloadable from the Author Page

Demonstrate the ability to navigate through libraries and view data sets

Think critically about all messages SAS places in the log to determine their cause and

severity

Apply ODS statements to manage output and output destinations

Explain the basic rules and structure of the SAS language

Demonstrate the ability to apply a template to customize output

Use the concepts of this chapter to solve the problems in the wrap‐up activity. Additional

exercises and case‐studies are also available to test these concepts.

1.3 SAS Environments

Interacting with SAS is possible in a variety of environments, including SAS from the command

line, the SAS windowing environment, SAS Enterprise Guide, SAS Studio, and SAS University

Edition; with most of these being available on multiple operating systems. This chapter

introduces the SAS windowing environment, SAS Studio, and SAS University Edition on the

Microsoft Windows operating system and points out key differences between those SAS

environments. For further specifics on differences across SAS environments and operating

systems, consult the appropriate SAS Documentation. In nearly all examples in this book, code

is given outside of any specific environment and output is shown in generic RTF‐style tables or

standard image formats. Output may vary somewhat from the default styles across SAS

environments on various operating systems, and examples later in this chapter demonstrate

some of these differences. Later chapters give information about how to duplicate the table

styles.

1.3.1 The SAS Windowing Environment

The SAS windowing environment is shown in Figure 1.3.1 with three windows visible: Log,

Explorer, and Editor (commonly referred to as the Enhanced Program Editor). The Results and

Output windows are two other windows commonly available by default, but are typically

obfuscated by other windows at launch. When code that generates output is executed, these

windows (and possibly others) become relevant.

Figure 1.3.1: SAS Windowing Environment on Microsoft Windows

In the Microsoft Windows operating system, the menu and toolbars in the SAS windowing

environment have a similar look and feel compared to other programs running on Windows.

Exploring the menus reveals standard options under the File, Edit, and Help menus (such as

Open, Save, Clear, Find). The View, Tools, Solutions, and Window menus have specialized

options related to windows and utilities that are specific to SAS. The Run menu is dedicated to

submissions of SAS code, including submissions to a remote session. As is typical in most

applications, toolbar buttons in SAS provide quick access to common menu functions and vary

depending on which window is active in the session. Some menu and toolbar options are

reviewed below during the execution of the supplied sample code given in Program 1.3.1. This

sample code is available from the author web pages for this book.

Program 1.3.1: Demonstration Code

options ps=100 ls=90 number pageno=1 nodate;

data work.cars;

set sashelp.cars;

mpg_combo=0.6*mpg_city+0.4*mpg_highway;

select(type);

when(‘Sedan’,’Wagon’) typeB=’Sedan/Wagon’;

when(‘SUV’,’Truck’) typeB=’SUV/Truck’;

otherwise typeB=type;

end;

label mpg_combo=’Combined MPG’ typeB=’Simplified Type’;

run;

title ‘Combined MPG Means’;

proc sgplot data=work.cars;

hbar typeB / response=mpg_combo stat=mean limits=upper;

where typeB ne ‘Hybrid’;

run;

title ‘MPG Five­Number Summary’;

title2 ‘Across Types’;

proc means data=cars min q1 median q3 max maxdec=1;

class typeB;

var mpg:;

run;

After downloading the code to a known directory, there are multiple ways to navigate to and

open this code. Figure 1.3.2 shows two methods to open the file, each requiring the Editor

window to be active.

Figure 1.3.2: Methods for Opening SAS Code Files in the SAS Windowing Environment

Either of these choices launches a standard Microsoft Windows file selection window, which is

used to navigate to and select the file of interest. Upon successful selection of the code, it

appears in the Editor window, and is displayed with some color coding as shown in Figure 1.3.3

(assuming the Enhanced Program Editor is in use, the Program Editor window provides

different color coding). It is not important to understand the specific syntax or how the code

works at this point, for now it is used simply to provide an executable program to introduce

some SAS fundamentals.

Code submission can also occur in multiple ways, two of which are shown in Figure 1.3.3, again

each method requires the Editor window to be the active window in the session. If multiple

Editor windows are open, only code from the active window is submitted.

Figure 1.3.3: Submitting SAS Code in the SAS Windowing Environment

Typically, after any code submission the Results window activates and displays an index of links

to various entities produced by the program, including output tables. While not all SAS code

generates output, Program 1.3.1 does, and it may be routed to different destinations (and

possibly more than one destination simultaneously) depending on the version of SAS in use

and current option settings.

In SAS 9.4, the default settings route output to an HTML file which is displayed in the Results

Viewer, a viewing window internal to the SAS session. Previous versions of SAS rely on the

Output window for tables, an option which remains available for use in the SAS 9.4 windowing

environment, and other specialized destinations for graphics. Default output options can be

set by navigating to the Tools menu, selecting Options, followed by Preferences from that sub‐

menu, and choosing the Results tab in the window that appears, as shown in Figure 1.3.4.

Figure 1.3.4: Managing Output for Program Submissions

Among other options, Figure 1.3.4 shows the option for Create HTML checked and Create

Listing unchecked. For tables, the listing destination is the Output window, so when Create

Listing is checked, tables also appear in the Output window in what appears as a plain text

form. It is possible to check both boxes, and it is also possible to check neither, whichever is

preferred.

In the remainder of this book, output tables are shown in an RTF form embedded inside the

book text, outside of any SAS Results window. Appearance of output tables and graphs in the

book is similar to what is produced by a SAS session, but is not necessarily identical when

default session options are in place. Later in this chapter, the ability to use SAS code to control

delivery of output to each of these destinations is demonstrated, along with use of the listing

destination as an output destination for graphics files.

1.3.2 SAS Studio and SAS University Edition

SAS Studio and SAS University Edition (which are, for the remainder of this text, singularly

referred to as SAS University Edition) interface with SAS through a web browser. Typically, the

browser used is the default browser for the machine hosting the SAS University Edition

session, but this is not a requirement. Figure 1.3.5 shows a typical result of launching SAS

University Edition (in this case using the Firefox browser on Microsoft Windows), launching in

visual programmer mode by default. A closer match to the structure of the SAS windowing

environment is provided by selecting SAS Programmer from the toolbar as shown.

Figure 1.3.5: SAS University Edition

Opening a program is accomplished via the Open icon on the toolbar, as illustrated in Figure

1.3.6, and the opened code is displayed in a manner very similar to the that of the Enhanced

Program Editor display shown in Section 1.3.1.

Figure 1.3.6: Opening a Program in SAS University Edition

Though in a different position, the toolbar icon for submission is the same as in the SAS

windowing environment, and selecting it produces output in the Results tab as shown in Figure

1.3.7.

Figure 1.3.7: Execution of a Program in SAS University Edition

A few important differences to note in SAS University Edition: first, the output is displayed

starting at the top, rather than at the bottom of the page as in the SAS windowing

environment. Second, there is an additional tab for Output Data in this session. In Section

1.4.3, libraries, data sets, and navigation to each are discussed; however, SAS University

Edition also includes a special tab whenever a program generates new data sets, which aids in

directly viewing those results. Finally, note that the Code, Log, Results, and Output Data tabs

are contained within the Program 1.3.1 tab, and each program opened is given its own set of

tabs. In contrast, the SAS windowing environment supports multiple Editor windows in a single

session, but they all share a common Log window, Output window, and (under default

conditions) output HTML file. As discussed in other examples and in Chapter Notes 1 and 2 in

Section 1.7, submissions from any and all Editor windows in the SAS windowing environment

are cumulative in the Log and Output windows; therefore, managing results in each

environment is quite different.

1.4 SAS Fundamentals

To build an initial understanding of how to work with programs in SAS, Program 1.3.1 is used

repeatedly in this section to introduce various SAS language elements and concepts. For both

SAS windowing environment and SAS University Edition, the features of each environment and

navigation within them are discussed in conjunction with the language elements that relate to

them.

1.4.1 SAS Language Basics

Program 1.4.1 is a duplicate of Program 1.3.1 with certain elements noted numerically

throughout the code, followed by notes on the specific code in the indicated position.

Throughout this book, this style is used to detail important features found in sample code.

Program 1.4.1: Program 1.3.1, Revisited

options ps=100 ls=90 number pageno=1 nodate;

data work.cars;

set sashelp.cars;

MPG_Combo=0.6*mpg_city+0.4*mpg_highway;

select(type);

when(‘Sedan’,’Wagon’) TypeB=’Sedan/Wagon’;

when(‘SUV’,’Truck’) TypeB=’SUV/Truck’;

otherwise TypeB=type;

end;

label mpg_combo=’Combined MPG’ typeB=’Simplified Type’;

run;

title ‘Combined MPG Means’;

proc sgplot data=work.cars;

hbar typeB / response=mpg_combo stat=mean limits=upper;

where typeB ne ‘Hybrid’;

run;

title ‘MPG Five­Number Summary’;

title2 ‘Across Types’;

proc means data=work.cars min q1 median q3 max maxdec=1;

class typeB;

var mpg:;

run;

 SAS code is written in statements, each of which ends in a semicolon. The statements

indicated here (OPTIONS and TITLE) are examples of global statements. Global statements are

statements that take effect as soon as SAS compiles those statements. Typically, the effects

remain in place during the SAS session until another statement is submitted that alters those

effects.

 The SAS DATA step has a variety of uses; however, it is primarily a tool for creation or

manipulation of data sets. A DATA step is generally comprised of several statements forming a

block of code, ending with the RUN statement, the role of which is described in .

 Procedures in SAS are used for a variety of tasks and, like the DATA step, are generally

comprised of several statements. These are generically referred to as PROC steps.

 The PROC MEANS result includes the variables MPG_City, MPG_Highway, and MPG_Combo

even though none of these are explicitly written in the procedure code. The colon (:) at the end

of a variable name acts as a wildcard indicating that any variable name starting with the prefix

given is part of the designated set, this shortcut is known in SAS as a name prefix list. For other

types of variable lists, see Chapter Note 3 in Section 1.7.

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

Top Grade Essay
Top Essay Tutor
Supreme Essay Writer
A+GRADE HELPER
Assignment Hub
Financial Assignments
Writer Writer Name Offer Chat
Top Grade Essay

ONLINE

Top Grade Essay

After reading your project details, I feel myself as the best option for you to fulfill this project with 100 percent perfection.

$16 Chat With Writer
Top Essay Tutor

ONLINE

Top Essay Tutor

I am an experienced researcher here with master education. After reading your posting, I feel, you need an expert research writer to complete your project.Thank You

$45 Chat With Writer
Supreme Essay Writer

ONLINE

Supreme Essay Writer

I have worked on wide variety of research papers including; Analytical research paper, Argumentative research paper, Interpretative research, experimental research etc.

$30 Chat With Writer
A+GRADE HELPER

ONLINE

A+GRADE HELPER

I have read your project description carefully and you will get plagiarism free writing according to your requirements. Thank You

$37 Chat With Writer
Assignment Hub

ONLINE

Assignment Hub

I am an elite class writer with more than 6 years of experience as an academic writer. I will provide you the 100 percent original and plagiarism-free content.

$29 Chat With Writer
Financial Assignments

ONLINE

Financial Assignments

Being a Ph.D. in the Business field, I have been doing academic writing for the past 7 years and have a good command over writing research papers, essay, dissertations and all kinds of academic writing and proofreading.

$29 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

Advanced practice nursing essentials for role development - The playoffs graphing inequalities 7.1 answers - Socw 6456 assignment - Chapter 17 mechanical waves and sound wordwise answers - Sons and lovers summary chapter wise - Role of computer in accounting ppt - Mrs goggins dancewear - Colonial adventure tours sql - Sociolinguistics multiple choice questions - Computer Science - Southwest region worksheet - Civil and infrastructure engineering rmit - Application letter for civil engineering job - Predicting consumer tastes with big data at gap case summary - Li young lee poems analysis - 5x 2y 2 x 2y 2 - SOCW6111 - What tool should xochi use to search and manage this information? - Transferring and transforming energy - Written Assignment #4: Management Training - Work breakdown structure - IDM W 4 Midterm - Pronombres objeto directo e indirecto - Week 9 - Art museum scavenger hunt worksheet - Project s has a cost of $10000 and is expected - What is the minimum number of subnets required - Foundation of the Army leadership - Can you use sohcahtoa for non right triangles - Mother by seamus heaney - A countershaft carrying two v belt pulleys - Professional Experience #5 - A consolidation rotates data to display alternative presentations of the data. - Practical connection- Enterprise Risk Management - The meaning of the combining form orchi/o is - Shyam selvadurai and andrew champion - Label the following terms as estado civil, fiesta, or etapa de la vida. - How to make benzoic - Kelly pitney comprehensive problem 1 - Write a resume and cover letter according to the instructions on the attached document - Fin/ project budget and finance - Which theorist discovered the “risky shift phenomenon”? - Decision making styles soc 110 - Gpib usb hs manual - Marketing Reseach - Do blobfish have muscles - Vcaa chemistry 2012 exam 2 - Maya angelou quotes christmas lights - Probability And Statistical Inference - Despair the sopranos gangsta hip hop rap instrumental beat - What outcomes do horizontal merger and acquisition strategies intend - What is the nursing metaparadigm - A(n) ____ is a promise to reward and compensate a customer if a service upset occurs. - CMST 303 Week 6 discussion - Management Consulting Template: “The Pearl Industry: Is there a market opportunity?”) • Template provided (fillable) - Convert to conjunctive normal form example - On course strategies for creating success in college - Http www plagiarism org plag_article_citation_styles html - Tort Law - How to calculate ccal of calorimeter - Zener diode as voltage regulator lab experiment - Philosophy in the tragic age of the greeks - Social integration and influence in group dynamics - Mikrotik send email multiple recipients - Business Plan - Romans 15 1b 3a 5 7 13 - Avoiding run on sentences - Constantine the great vision - Journal 1 - Why is context dependent memory important - Overhead crane runway design - What does an hr diagram relate a star's temperature to - Dess lumpkin eisner strategic management pdf - Soc 110 creating an agenda - Compare and contrast short term and long term memory - Introduction to the study of film form and representation - Assumptions and constraints examples - Structural Versus Strategic Family Therapies - Four atoms are arbitrarily labeled - HRM671 LEARNING THEORIES AND TECHNOLOGY - What factors affect the quality of an lcd monitor - Prosectus Draft - CYPRODEV812 - I- to i2 half equation - An infinitely long line charge having a uniform - The key feature of an oligopolistic market is - Budget and Profit Loss Statement due in 60 hours - Cis 500 week 4 - 8 1 mymarketinglab simulation activity market research answers - Authoritative Sources & Links Narrative Assignment - Jasper jones jeffrey lu cricket - Sex education essay conclusion - Locate a peer-reviewed article (related to the course content) published within the last 12 months in a peer-reviewed journal from the online library. - The case for short words richard lederer - Annotated bibliography - 111 webb avenue ballarat east - The letter p in the acronym erp stands for - Where can you buy colgate wisp in canada - Brown black yellow resistor value - Process Costing & cost behavior