Instructor: Raul Cruz-Cano

Slides:



Advertisements
Similar presentations
Data Analysis using SPSS By Dr. Shaik Shaffi Ahamed Ph. D
Advertisements

Statistical Methods Lynne Stokes Department of Statistical Science Lecture 7: Introduction to SAS Programming Language.
Introduction to SAS Programming Christina L. Ughrin Statistical Software Consulting Some notes pulled from SAS Programming I: Essentials Training.
The Web Warrior Guide to Web Design Technologies
CGS 1060 Introduction to MicroComputer Usage Chapter 1 Windows 7
Welcome to SAS…Session..!. What is SAS..! A Complete programming language with report formatting with statistical and mathematical capabilities.
The basics of the Online Portal
Introduction to Access By Mary Ann Chaney and Alicia Harkleroad.
SAS Workshop Lecture 1 Lecturer: Annie N. Simpson, MSc.
Introduction to SAS BIO 226 – Spring Outline Windows and common rules Getting the data –The PRINT and CONTENT Procedures Manipulating the data.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Lesson 1 Introduction.
EPIB 698C Lecture 2 Notes Instructor: Raul Cruz 2/14/11 1.
Tutorial 11 Five windows included in the Visual Basic Startup Screen Main Form Toolbox Project Explorer (Project) Properties.
Chapter 1: Introduction to SAS  SAS programs: A sequence of statements in a particular order  Rules for SAS statements: –Every SAS statement ends in.
Microsoft Office 2008 for Mac – Illustrated Unit C: Understanding File Management.
Basic Computer and Word Functions, part 1 Read the information and use to answer the questions in the Basic Computer and Word Functions Study Guide.
1 EPIB 698E Lecture 1 Notes Instructor: Raul Cruz 7/9/13.
1 Data Manipulation (with SQL) HRP223 – 2010 October 13, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
Chapter 5 Reading and Manipulating SAS ® Data Sets and Creating Detailed Reports Xiaogang Su Department of Statistics University of Central Florida.
Key Applications Module Lesson 17 — Organizing Worksheets Computer Literacy BASICS.
1 Introduction to SAS Available at
Chapter 1: Overview of SAS System Basic Concepts of SAS System.
Computing with SAS Software A SAS program consists of SAS statements. 1. The DATA step consists of SAS statements that define your data and create a SAS.
Introduction to Programming Python Lab 5: Strings and Output 05 February PythonLab5 lecture slides.ppt Ping Brennan
1 Introduction to SAS Available at
1 Data Manipulation (with SQL) HRP223 – 2009 October 12, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
1 EPIB 698C Lecture 1 Instructor: Raul Cruz-Cano
SAS Certification Prep Guide Chapter 7 Creating and Applying User-Defined Formats.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 14 & 19 By Tasha Chapman, Oregon Health Authority.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 3 & 4 By Tasha Chapman, Oregon Health Authority.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 11 Creating Web Applications and Writing Data to a Database.
Visual Basic.NET Windows Programming
Temporary vs. Permanent SAS Data Sets
Introduction to Programming
International Computer Driving Licence Syllabus version 5.0
Applied Business Forecasting and Regression Analysis
Key Applications Module Lesson 17 — Organizing Worksheets
Introduction to Programming
Microsoft Excel A Spreadsheet Program.
Instructor: Raul Cruz-Cano 7/9/2012
SAS Programming Introduction to SAS.
Access Lesson 1 Understanding Access Fundamentals
Chapter 1: Introduction to SAS
Tamara Arenovich Tony Panzarella
Microsoft Visual Basic 2005 BASICS
Introduction to Programming
WEB PROGRAMMING JavaScript.
CIS16 Application Programming with Visual Basic
Siebel Open UI Features & Updates
Integrating JavaScript and HTML
Access Lesson 2 Creating a Database
Chapter 4 File Basics.
CIS 16 Application Development Programming with Visual Basic
Introduction to Programming
Introduction to Programming
Eviews Tutorial for Labor Economics Lei Lei
From and Report.
Introduction to Programming
Data Manipulation (with SQL)
Running a Java Program using Blue Jay.
Instructor: Raul Cruz 9/4/13
Microsoft Office Illustrated Fundamentals
Introduction to Programming
Microsoft Windows 7 Basics
Introduction to MS ACCESS
Unit J: Creating a Database
Exploring Microsoft Word 2003
Microsoft Excel 2007 – Level 2
Presentation transcript:

Instructor: Raul Cruz-Cano raulcruz@umd.edu EPIB 698C Lecture 2 Instructor: Raul Cruz-Cano raulcruz@umd.edu 1 1

Note: http://www.oit.umd.edu/wheretogo/ + Room 1304 SAS Data Libraries A SAS library is simply a location where SAS data sets are stored Explorer window, click on “libraries”, there are at least three libraries: Sashelp, Sasuser and work. Sashelp and Sasuser contains information that controls your SAS session. Work is the default library, it is a temporary storage location for SAS data sets. Note: http://www.oit.umd.edu/wheretogo/ + Room 1304 2

Creating a new library Make the “Active libraries” window active (click Explorer, then click libraries) Choose “New” from the File menu or right click in the active libraries window and choose “New” from the pop-up menu 3

Creating a new library Type the name of the library in the box after name. This name must be eight characters or fewer, and contains only letters, numbers and underscore. In the path field, type in the complete path to the folder or directory where you want to save your data (or use Browse) 4

Creating a new library Another way to create a new library is to use the LIBNAME statement to associate the library with a directory accessible from your computer. LIBNAME mylib ‘H:/EPIB698A/week1’; associates the directory h:/EPIB698A/week1 with the name mylib. Mylib is known as a libref (a library reference) 5

Temporary/permanent SAS datasets Every SAS dataset is stored in a SAS data library. By default all data sets created during a SAS session are temporary data sets and are deleted when you close SAS. All data sets associated with the library WORK are deleted at the end of the SAS session (they are temporary). A permanent data set is a data set that will not be deleted when SAS is exited. To create a permanent data set, simply use a different library name to create a data set.

To create Permanent SAS datasets Code to create permanent SAS datasets libname yourlib ‘H:/EPIB698A/week1'; data yourlib.instructor; input name $ sex $ age; cards; Mike M 30 Wen F 29 Wei F 28 ; run;

To access Permanent SAS datasets When you start a new SAS session, the permanent datasets can be accessed directly using libref. The name of the libref can be different from the name you used when creating the permanent data set. libname mylib ‘H:/EPIB698A/week1'; proc print data=mylib.instructor; run; Part 3 of Code 8

Viewing SAS data with SAS Explorer Click the libraries icon in the Explorer window Click the library you want to see Click the data name to open a SAS data To go back to the previous window within Explorer, choose “up one level” from the view menu, or click the up one level button on the toolbar 9

Listing the properties of a SAS data set Right click the SAS data icon Select “Properties” from the pop up menu If choose columns, SAS displays information about the columns (or variables) in the data set. 10

Using SAS system options System options are parameters you can change that affect SAS: how it works, what the output look like, how much memory used, et al. You can see the list of system options and their current values by the following procedure: Proc options; run; 11

Change system options Options statement: it starts with the keyword “Options” and follows with a list of options you want to change with their values. Options Linesize=80 nodate; 12

Change system options Another way to change system options is to use the SAS system options window Type “Options” in the command bar or select it from the Tools pull-down menu: optionssystemlocate options from the left side of the screenright click specific options to change values 13

Common options Center|Nocenter: output centered or left-justified Date|Nodate: today’s date appear in the output window Linesize=n: maximum length of output lines, possible values are 64 to 256. Number|Nonumber: page number for output window 14

Common options Pageno=n: starts numbering output pages with n Pagesize=n: controls maximum number of lines per page of output. Possible values are 15 to 32767 15

PROC contents PROC contents prints the descriptive information about the data set and the variables in the data set Data set information: name, number of observations, number of variables, and date created Variable information: name, internal order, type, length, format/informat, and label Very useful for snapshot a data set Syntax: proc contents data=data_set_name; run;

TITLES Titles are descriptive headers SAS places at the top of each page of the OUT window. A title is set with the TITLE statement followed by a string of character. The string must be enclosed in single or double quotes. The maximum length for a string is 200 characters. If you want multiple line titles you can use the TITLE statement where the word title is followed by a number: title1 ‘EPIB 698C'; title2 'week1'; To clear the title setting simply execute title;

PROC print The PRINT procedure prints the observations in a SAS data set to the output window. Features: Autoformatting columns labeled with variable names or labels automatic accumulation and printing of subtotals and totals Syntax: proc print data=data_set_name options; var var1 var2 var3 var4; run; 18

PROC print (cont.) Useful options with PROC print: double: double spaces the output noobs: suppresses observation numbers label: uses variable labels as column headings Id: suppresses observation numbers but put ID variable on the left-hand side of the page added statements for use in PROC print: prints different section at each level of “by” variable (needs a “sort” statement): by name_of_by_variable; sums variables at bottom of output: sum variable_list; 19

PROC print (cont.) The var statement The var statement is used to specify the variables to process in a proc step. Not unique to proc print. Variables are usually processed in the order listed in the var statement. Only applies to a local proc step (not global) If no var statement is used, generally the procedure will process all the variables (or all the numeric variables if a calculation is performed). Part 4 of Code 20