SlideShare a Scribd company logo
Introduction To
SAS
Need to know
– SAS environment
– SAS files (datasets, catalogs etc) & libraries
– SAS programs
How to:
 Get data in
 Manipulate data
 Get results out
SAS software
environment
SAS Windows (SAS 9)
Some (!) SAS windows
– Editor
Where code is written or imported, and submitted
– Log
What happened, including what went wrong
– Output
Results of program procedures that produce output
– Explorer
Shows libraries (SAS & Windows), their files, and where you can see data, graphs
– Results
Shows how the output is made up of tables, graphs, datasets etc
– Notepad
A useful place to keep bits of code
SAS software
programs
SAS Programs
data one;
input x y;
datalines;
-3.2 0.0024
-3.1 0.0033
. . .
;
run;
proc print data = one (obs = 5);
run;
proc means data = one;
run;
DATA step
creates SAS data set
PROC steps
process data in data set
SAS steps begin with a
 DATA statement
 PROC statement.
SAS detects the end of a step when it encounters
 a RUN statement (for most steps)
 a QUIT statement (for some procedures)
 the beginning of another step (DATA statement or PROC statement).
 Recommendation: use RUN; at end of each step
Step Boundaries
data seedwt;
input oz $ rad wt;
datalines;
Low 118.4 0.7
High 109.1 1.3
Low 215.2 2.9
run;
proc print data = two;
proc means data = seedwt;
class oz;
var rad wt;
run;
Step Boundaries
When you execute a SAS program, the output generated by SAS is divided
into two major parts:
SAS log contains information about the processing of
the SAS program, including any warning and
error messages.
SAS output contains reports generated by SAS
procedures and DATA steps.
Submitting a SAS Program
1) Submit all (or selected) code by
 F4
 Click on the runner in the toolbar
1) Read log
2) Look in output window
if you expect code to produce output
3) Problems
 Bad syntax
 Missing ; at end of line
 Missing quote ’ at end of title (nasty!)
Recommended steps!
Improved output - HTML
Tools → Options → Preferences→ Results
Do this & resubmit code
Check HTML output in Results Window
 
SAS data
sets
SAS data sets
• SAS procedures (PROC … ) process data from SAS data sets
• Need to know (briefly!)
– What a SAS data set looks like
– How to get out data into a SAS data set
SAS data sets
• live in libraries
• have a descriptor part (with useful info)
• have a data part which is a rectangular table of character
and/or numeric data values (rows called observations)
• have names with syntax
<libname.>datasetname
libname defaults to work if omitted
work library
SAS data sets with a single part name like
oz, wp or mybestdata99
1) are stored in the work library
2) can be referenced e.g. as
mybestdata99 or work.mybestdata99
3) are deleted at end of SAS session!
Don’t loose your data!
Keep the SAS program that read the data from its
original source
. . . More later!
Viewing descriptor & data
/* view descriptor part */
proc contents data = wp;
run;
/* view data part */
proc print data = work.wp;
run;
Alternatively:
Use SAS Explorer: Open (for data) Properties (for descriptor)
Properties is not as clear as CONTENTS
SAS variables
There are two types of variables:
• character contain any value: letters, numbers, special characters, and
blanks.
Character values are stored with a length of 1 to 32,767 bytes (default is 8).
One byte equals one character.
• numeric stored as floating point numbers in 8 bytes
of storage by default.
Eight bytes of floating point storage provide space for 16 or 17 significant
digits.
You are not restricted to 8 digits.
Don’t change the 8 byte length!
SAS variables
The CONTENTS Procedure
Alphabetic List of Variables and Attributes
# Variable Type Len
1 oz Char 8
2 rad Num 8
3 wt Num 8
OUTPUT
SAS names
– for data sets & variables
• can be 32 characters long.
• can be uppercase, lowercase, or mixed-case
but are not case sensitive!
• must start with a letter or underscore. Subsequent characters can be letters,
underscores, or numeric digits
- no %$!*&#@ or spaces.
LastName FirstName JobTitle Salary
TORRES JAN Pilot 50000
LANGKAMM SARAH Mechanic 80000
SMITH MICHAEL Mechanic .
WAGSCHAL NADJA Pilot 77500
TOERMOEN JOCHEN 65000
A value must exist for every variable for each observation.
Missing values are valid values.
A numeric
missing value
is displayed as
a period.
A character missing
value is displayed as
a blank.
Missing Data Values
SAS syntax
• Not case sensitive
• Each ‘line’ usually begins with keyword
and ends with ;
• Common Errors:
– Forget ;
– Miss-spelt or wrong keyword
– Missing final quote in title
title ‘Woodpecker Habitat; /* quote mark missing */
title ‘Woodpecker Habitat’;
Comments
1. Type /* to begin a comment.
2. Type your comment text.
3. Type */ to end the comment.
• To comment selected typed text remember: Ctrl+/
• Alternative:
* comment ;
SAS
Creating a SAS data set
Getting data in!
Consider 2 methods
1) Data in program (briefly!)
2) Data in Excel workbook
Getting data in!
Data in program file:
data oz;
input oz $ rad wt;
datalines;
Low 118.4 0.7
High 109.1 1.3
Low 215.2 2.9
. . .
;
run;
Note:
1. oz is text variable so requires $
2. No missing values
3. Values of oz
• don’t contain spaces
• are at most 8 character long
Getting data in!
from Excel
• Use IMPORT wizard
saving program to reduce future clicking!
Creating new variables
Adding a new variable to an existing SAS data set (say
work.old)
1. Use set
2. Give definition of new variable
data new;
/* read data from work.old */
set old;
y2 = y**2;
ly = log(y);
ly_base10 = log10(y);
t1 = (treat = 1);
run;
Data set: work.new
Obs treat y ysquared logy logy_base10 t1
1 A 10.0 100.00 2.30259 1 0
2 A 100.0 10000.00 4.60517 2 0
3 B -10.0 100.00 . . 1
4 B 0.0 0.00 . . 1
5 B 0.1 0.01 -2.30259 -1 1
Data Screening
Data Screening
checking input data for gross errors
• Use PRINT procedure to scan for obvious anomalies
• Use MEANS procedure & examine summary table
– MAXIMUM, MINIMUM – reasonable?
– MEAN - near middle of range?
– MISSING VALUES - input or calculation error e.g. log(0)?
– CV (= 100*std.dev/mean) - < 10% for plant growth, between 12
& 30% for animal production variables, > 50% implies skewness
for any positive variable
Dealing with data errors
• Check original records
• Change mistakes in recording where the correct value is
beyond question
• Regenerate observations where possible – e.g.
reweigh sample, redo chemical analysis
• With a large body of data in an unbalanced design err on the
side of omitting questionable data
Do not proceed until data has been properly
cleaned – if necessary perform a number of
screening runs
For More Information click below link:
Follow Us on:
http://vibranttechnologies.co.in/sas-classes-in-mumbai.html
Thank You !!!

More Related Content

What's hot

Sas
SasSas
Basics of SAS
Basics of SASBasics of SAS
Basics of SAS
Taddesse Kassahun
 
Base SAS Statistics Procedures
Base SAS Statistics ProceduresBase SAS Statistics Procedures
Base SAS Statistics Procedures
guest2160992
 
Introduction to clinical sas
Introduction to clinical sasIntroduction to clinical sas
Introduction to clinical sas
Vijayaraghava Karpurapu
 
Sas Statistical Analysis System
Sas Statistical Analysis SystemSas Statistical Analysis System
Sas Statistical Analysis System
Sushil kasar
 
SAS Macros
SAS MacrosSAS Macros
SAS Macros
guest2160992
 
Introduction To Sas
Introduction To SasIntroduction To Sas
Introduction To Sashalasti
 
SAS Macros part 1
SAS Macros part 1SAS Macros part 1
SAS Macros part 1venkatam
 
SAS Functions
SAS FunctionsSAS Functions
SAS Functions
guest2160992
 
Utility Procedures in SAS
Utility Procedures in SASUtility Procedures in SAS
Utility Procedures in SAS
guest2160992
 
A complex ADaM dataset - three different ways to create one
A complex ADaM dataset - three different ways to create oneA complex ADaM dataset - three different ways to create one
A complex ADaM dataset - three different ways to create one
Kevin Lee
 
Introduction to SAS Data Set Options
Introduction to SAS Data Set OptionsIntroduction to SAS Data Set Options
Introduction to SAS Data Set Options
Mark Tabladillo
 
SDTM (Study Data Tabulation Model)
SDTM (Study Data Tabulation Model)SDTM (Study Data Tabulation Model)
SDTM (Study Data Tabulation Model)
SWAROOP KUMAR K
 
ADaM - Where Do I Start?
ADaM - Where Do I Start?ADaM - Where Do I Start?
ADaM - Where Do I Start?
Dr.Sangram Parbhane
 
SAS - Statistical Analysis System
SAS - Statistical Analysis SystemSAS - Statistical Analysis System
SAS - Statistical Analysis System
Dr-Jitendra Patel
 
Clinical sas programmer
Clinical sas programmerClinical sas programmer
Clinical sas programmerray4hz
 
Proc SQL in SAS Enterprise Guide 4.3
Proc SQL in SAS Enterprise Guide 4.3Proc SQL in SAS Enterprise Guide 4.3
Proc SQL in SAS Enterprise Guide 4.3Mark Tabladillo
 
CDISC SDTM Domain Presentation
CDISC SDTM Domain PresentationCDISC SDTM Domain Presentation
CDISC SDTM Domain PresentationAnkur Sharma
 

What's hot (20)

Sas
SasSas
Sas
 
Basics of SAS
Basics of SASBasics of SAS
Basics of SAS
 
Base SAS Statistics Procedures
Base SAS Statistics ProceduresBase SAS Statistics Procedures
Base SAS Statistics Procedures
 
Introduction to clinical sas
Introduction to clinical sasIntroduction to clinical sas
Introduction to clinical sas
 
Sas Statistical Analysis System
Sas Statistical Analysis SystemSas Statistical Analysis System
Sas Statistical Analysis System
 
SAS Macros
SAS MacrosSAS Macros
SAS Macros
 
Introduction To Sas
Introduction To SasIntroduction To Sas
Introduction To Sas
 
Sas demo
Sas demoSas demo
Sas demo
 
SAS Macros part 1
SAS Macros part 1SAS Macros part 1
SAS Macros part 1
 
SAS Functions
SAS FunctionsSAS Functions
SAS Functions
 
Sas cheat
Sas cheatSas cheat
Sas cheat
 
Utility Procedures in SAS
Utility Procedures in SASUtility Procedures in SAS
Utility Procedures in SAS
 
A complex ADaM dataset - three different ways to create one
A complex ADaM dataset - three different ways to create oneA complex ADaM dataset - three different ways to create one
A complex ADaM dataset - three different ways to create one
 
Introduction to SAS Data Set Options
Introduction to SAS Data Set OptionsIntroduction to SAS Data Set Options
Introduction to SAS Data Set Options
 
SDTM (Study Data Tabulation Model)
SDTM (Study Data Tabulation Model)SDTM (Study Data Tabulation Model)
SDTM (Study Data Tabulation Model)
 
ADaM - Where Do I Start?
ADaM - Where Do I Start?ADaM - Where Do I Start?
ADaM - Where Do I Start?
 
SAS - Statistical Analysis System
SAS - Statistical Analysis SystemSAS - Statistical Analysis System
SAS - Statistical Analysis System
 
Clinical sas programmer
Clinical sas programmerClinical sas programmer
Clinical sas programmer
 
Proc SQL in SAS Enterprise Guide 4.3
Proc SQL in SAS Enterprise Guide 4.3Proc SQL in SAS Enterprise Guide 4.3
Proc SQL in SAS Enterprise Guide 4.3
 
CDISC SDTM Domain Presentation
CDISC SDTM Domain PresentationCDISC SDTM Domain Presentation
CDISC SDTM Domain Presentation
 

Similar to SAS - overview of SAS

Prog1 chap1 and chap 2
Prog1 chap1 and chap 2Prog1 chap1 and chap 2
Prog1 chap1 and chap 2rowensCap
 
Introduction to SAS
Introduction to SASIntroduction to SAS
Introduction to SASImam Jaffer
 
Introducción al Software Analítico SAS
Introducción al Software Analítico SASIntroducción al Software Analítico SAS
Introducción al Software Analítico SAS
Jorge Rodríguez M.
 
Introduction to-sas-1211594349119006-8
Introduction to-sas-1211594349119006-8Introduction to-sas-1211594349119006-8
Introduction to-sas-1211594349119006-8thotakoti
 
INTRODUCTION TO STATA.pptx
INTRODUCTION TO STATA.pptxINTRODUCTION TO STATA.pptx
INTRODUCTION TO STATA.pptx
Dhananjaykumar464035
 
I need help with Applied Statistics and the SAS Programming Language.pdf
I need help with Applied Statistics and the SAS Programming Language.pdfI need help with Applied Statistics and the SAS Programming Language.pdf
I need help with Applied Statistics and the SAS Programming Language.pdf
Madansilks
 
Database development coding standards
Database development coding standardsDatabase development coding standards
Database development coding standardsAlessandro Baratella
 
SAS Commands
SAS CommandsSAS Commands
SAS Commands
Suvojyoti Chowdhury
 
Hechsp 001 Chapter 2
Hechsp 001 Chapter 2Hechsp 001 Chapter 2
Hechsp 001 Chapter 2
Brian Kelly
 
Introduction to sas.pptx
Introduction to sas.pptxIntroduction to sas.pptx
Introduction to sas.pptx
AvinabaHandson
 
Sas-training-in-mumbai
Sas-training-in-mumbaiSas-training-in-mumbai
Sas-training-in-mumbai
Unmesh Baile
 
Sas Talk To R Users Group
Sas Talk To R Users GroupSas Talk To R Users Group
Sas Talk To R Users Group
georgette1200
 
Part III: Assembly Language
Part III: Assembly LanguagePart III: Assembly Language
Part III: Assembly LanguageAhmed M. Abed
 
Matlab ppt
Matlab pptMatlab ppt
Matlab ppt
chestialtaff
 
Sample Questions The following sample questions are not in.docx
Sample Questions The following sample questions are not in.docxSample Questions The following sample questions are not in.docx
Sample Questions The following sample questions are not in.docx
todd331
 
8323 Stats - Lesson 1 - 03 Introduction To Sas 2008
8323 Stats - Lesson 1 - 03 Introduction To Sas 20088323 Stats - Lesson 1 - 03 Introduction To Sas 2008
8323 Stats - Lesson 1 - 03 Introduction To Sas 2008
untellectualism
 

Similar to SAS - overview of SAS (20)

Prog1 chap1 and chap 2
Prog1 chap1 and chap 2Prog1 chap1 and chap 2
Prog1 chap1 and chap 2
 
Introduction to SAS
Introduction to SASIntroduction to SAS
Introduction to SAS
 
Introducción al Software Analítico SAS
Introducción al Software Analítico SASIntroducción al Software Analítico SAS
Introducción al Software Analítico SAS
 
Introduction to-sas-1211594349119006-8
Introduction to-sas-1211594349119006-8Introduction to-sas-1211594349119006-8
Introduction to-sas-1211594349119006-8
 
SAS - Training
SAS - Training SAS - Training
SAS - Training
 
INTRODUCTION TO STATA.pptx
INTRODUCTION TO STATA.pptxINTRODUCTION TO STATA.pptx
INTRODUCTION TO STATA.pptx
 
I need help with Applied Statistics and the SAS Programming Language.pdf
I need help with Applied Statistics and the SAS Programming Language.pdfI need help with Applied Statistics and the SAS Programming Language.pdf
I need help with Applied Statistics and the SAS Programming Language.pdf
 
Database development coding standards
Database development coding standardsDatabase development coding standards
Database development coding standards
 
SAS Commands
SAS CommandsSAS Commands
SAS Commands
 
pm1
pm1pm1
pm1
 
Hechsp 001 Chapter 2
Hechsp 001 Chapter 2Hechsp 001 Chapter 2
Hechsp 001 Chapter 2
 
Introduction to sas.pptx
Introduction to sas.pptxIntroduction to sas.pptx
Introduction to sas.pptx
 
Sas-training-in-mumbai
Sas-training-in-mumbaiSas-training-in-mumbai
Sas-training-in-mumbai
 
Sas Talk To R Users Group
Sas Talk To R Users GroupSas Talk To R Users Group
Sas Talk To R Users Group
 
Part III: Assembly Language
Part III: Assembly LanguagePart III: Assembly Language
Part III: Assembly Language
 
SAS_Overview_Short.pptx
SAS_Overview_Short.pptxSAS_Overview_Short.pptx
SAS_Overview_Short.pptx
 
Matlab ppt
Matlab pptMatlab ppt
Matlab ppt
 
Sample Questions The following sample questions are not in.docx
Sample Questions The following sample questions are not in.docxSample Questions The following sample questions are not in.docx
Sample Questions The following sample questions are not in.docx
 
Sas summary guide
Sas summary guideSas summary guide
Sas summary guide
 
8323 Stats - Lesson 1 - 03 Introduction To Sas 2008
8323 Stats - Lesson 1 - 03 Introduction To Sas 20088323 Stats - Lesson 1 - 03 Introduction To Sas 2008
8323 Stats - Lesson 1 - 03 Introduction To Sas 2008
 

More from Vibrant Technologies & Computers

Buisness analyst business analysis overview ppt 5
Buisness analyst business analysis overview ppt 5Buisness analyst business analysis overview ppt 5
Buisness analyst business analysis overview ppt 5
Vibrant Technologies & Computers
 
SQL Introduction to displaying data from multiple tables
SQL Introduction to displaying data from multiple tables  SQL Introduction to displaying data from multiple tables
SQL Introduction to displaying data from multiple tables
Vibrant Technologies & Computers
 
SQL- Introduction to MySQL
SQL- Introduction to MySQLSQL- Introduction to MySQL
SQL- Introduction to MySQL
Vibrant Technologies & Computers
 
SQL- Introduction to SQL database
SQL- Introduction to SQL database SQL- Introduction to SQL database
SQL- Introduction to SQL database
Vibrant Technologies & Computers
 
ITIL - introduction to ITIL
ITIL - introduction to ITILITIL - introduction to ITIL
ITIL - introduction to ITIL
Vibrant Technologies & Computers
 
Salesforce - Introduction to Security & Access
Salesforce -  Introduction to Security & Access Salesforce -  Introduction to Security & Access
Salesforce - Introduction to Security & Access
Vibrant Technologies & Computers
 
Data ware housing- Introduction to olap .
Data ware housing- Introduction to  olap .Data ware housing- Introduction to  olap .
Data ware housing- Introduction to olap .
Vibrant Technologies & Computers
 
Data ware housing - Introduction to data ware housing process.
Data ware housing - Introduction to data ware housing process.Data ware housing - Introduction to data ware housing process.
Data ware housing - Introduction to data ware housing process.
Vibrant Technologies & Computers
 
Data ware housing- Introduction to data ware housing
Data ware housing- Introduction to data ware housingData ware housing- Introduction to data ware housing
Data ware housing- Introduction to data ware housing
Vibrant Technologies & Computers
 
Salesforce - classification of cloud computing
Salesforce - classification of cloud computingSalesforce - classification of cloud computing
Salesforce - classification of cloud computing
Vibrant Technologies & Computers
 
Salesforce - cloud computing fundamental
Salesforce - cloud computing fundamentalSalesforce - cloud computing fundamental
Salesforce - cloud computing fundamental
Vibrant Technologies & Computers
 
SQL- Introduction to PL/SQL
SQL- Introduction to  PL/SQLSQL- Introduction to  PL/SQL
SQL- Introduction to PL/SQL
Vibrant Technologies & Computers
 
SQL- Introduction to advanced sql concepts
SQL- Introduction to  advanced sql conceptsSQL- Introduction to  advanced sql concepts
SQL- Introduction to advanced sql concepts
Vibrant Technologies & Computers
 
SQL Inteoduction to SQL manipulating of data
SQL Inteoduction to SQL manipulating of data   SQL Inteoduction to SQL manipulating of data
SQL Inteoduction to SQL manipulating of data
Vibrant Technologies & Computers
 
SQL- Introduction to SQL Set Operations
SQL- Introduction to SQL Set OperationsSQL- Introduction to SQL Set Operations
SQL- Introduction to SQL Set Operations
Vibrant Technologies & Computers
 
Sas - Introduction to designing the data mart
Sas - Introduction to designing the data martSas - Introduction to designing the data mart
Sas - Introduction to designing the data mart
Vibrant Technologies & Computers
 
Sas - Introduction to working under change management
Sas - Introduction to working under change managementSas - Introduction to working under change management
Sas - Introduction to working under change management
Vibrant Technologies & Computers
 
Teradata - Architecture of Teradata
Teradata - Architecture of TeradataTeradata - Architecture of Teradata
Teradata - Architecture of Teradata
Vibrant Technologies & Computers
 
Teradata - Restoring Data
Teradata - Restoring Data Teradata - Restoring Data
Teradata - Restoring Data
Vibrant Technologies & Computers
 
Datastage database design and data modeling ppt 4
Datastage database design and data modeling ppt 4Datastage database design and data modeling ppt 4
Datastage database design and data modeling ppt 4
Vibrant Technologies & Computers
 

More from Vibrant Technologies & Computers (20)

Buisness analyst business analysis overview ppt 5
Buisness analyst business analysis overview ppt 5Buisness analyst business analysis overview ppt 5
Buisness analyst business analysis overview ppt 5
 
SQL Introduction to displaying data from multiple tables
SQL Introduction to displaying data from multiple tables  SQL Introduction to displaying data from multiple tables
SQL Introduction to displaying data from multiple tables
 
SQL- Introduction to MySQL
SQL- Introduction to MySQLSQL- Introduction to MySQL
SQL- Introduction to MySQL
 
SQL- Introduction to SQL database
SQL- Introduction to SQL database SQL- Introduction to SQL database
SQL- Introduction to SQL database
 
ITIL - introduction to ITIL
ITIL - introduction to ITILITIL - introduction to ITIL
ITIL - introduction to ITIL
 
Salesforce - Introduction to Security & Access
Salesforce -  Introduction to Security & Access Salesforce -  Introduction to Security & Access
Salesforce - Introduction to Security & Access
 
Data ware housing- Introduction to olap .
Data ware housing- Introduction to  olap .Data ware housing- Introduction to  olap .
Data ware housing- Introduction to olap .
 
Data ware housing - Introduction to data ware housing process.
Data ware housing - Introduction to data ware housing process.Data ware housing - Introduction to data ware housing process.
Data ware housing - Introduction to data ware housing process.
 
Data ware housing- Introduction to data ware housing
Data ware housing- Introduction to data ware housingData ware housing- Introduction to data ware housing
Data ware housing- Introduction to data ware housing
 
Salesforce - classification of cloud computing
Salesforce - classification of cloud computingSalesforce - classification of cloud computing
Salesforce - classification of cloud computing
 
Salesforce - cloud computing fundamental
Salesforce - cloud computing fundamentalSalesforce - cloud computing fundamental
Salesforce - cloud computing fundamental
 
SQL- Introduction to PL/SQL
SQL- Introduction to  PL/SQLSQL- Introduction to  PL/SQL
SQL- Introduction to PL/SQL
 
SQL- Introduction to advanced sql concepts
SQL- Introduction to  advanced sql conceptsSQL- Introduction to  advanced sql concepts
SQL- Introduction to advanced sql concepts
 
SQL Inteoduction to SQL manipulating of data
SQL Inteoduction to SQL manipulating of data   SQL Inteoduction to SQL manipulating of data
SQL Inteoduction to SQL manipulating of data
 
SQL- Introduction to SQL Set Operations
SQL- Introduction to SQL Set OperationsSQL- Introduction to SQL Set Operations
SQL- Introduction to SQL Set Operations
 
Sas - Introduction to designing the data mart
Sas - Introduction to designing the data martSas - Introduction to designing the data mart
Sas - Introduction to designing the data mart
 
Sas - Introduction to working under change management
Sas - Introduction to working under change managementSas - Introduction to working under change management
Sas - Introduction to working under change management
 
Teradata - Architecture of Teradata
Teradata - Architecture of TeradataTeradata - Architecture of Teradata
Teradata - Architecture of Teradata
 
Teradata - Restoring Data
Teradata - Restoring Data Teradata - Restoring Data
Teradata - Restoring Data
 
Datastage database design and data modeling ppt 4
Datastage database design and data modeling ppt 4Datastage database design and data modeling ppt 4
Datastage database design and data modeling ppt 4
 

Recently uploaded

Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 

Recently uploaded (20)

Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 

SAS - overview of SAS

  • 1.
  • 3. Need to know – SAS environment – SAS files (datasets, catalogs etc) & libraries – SAS programs How to:  Get data in  Manipulate data  Get results out
  • 6. Some (!) SAS windows – Editor Where code is written or imported, and submitted – Log What happened, including what went wrong – Output Results of program procedures that produce output – Explorer Shows libraries (SAS & Windows), their files, and where you can see data, graphs – Results Shows how the output is made up of tables, graphs, datasets etc – Notepad A useful place to keep bits of code
  • 8. SAS Programs data one; input x y; datalines; -3.2 0.0024 -3.1 0.0033 . . . ; run; proc print data = one (obs = 5); run; proc means data = one; run; DATA step creates SAS data set PROC steps process data in data set
  • 9. SAS steps begin with a  DATA statement  PROC statement. SAS detects the end of a step when it encounters  a RUN statement (for most steps)  a QUIT statement (for some procedures)  the beginning of another step (DATA statement or PROC statement).  Recommendation: use RUN; at end of each step Step Boundaries
  • 10. data seedwt; input oz $ rad wt; datalines; Low 118.4 0.7 High 109.1 1.3 Low 215.2 2.9 run; proc print data = two; proc means data = seedwt; class oz; var rad wt; run; Step Boundaries
  • 11. When you execute a SAS program, the output generated by SAS is divided into two major parts: SAS log contains information about the processing of the SAS program, including any warning and error messages. SAS output contains reports generated by SAS procedures and DATA steps. Submitting a SAS Program
  • 12. 1) Submit all (or selected) code by  F4  Click on the runner in the toolbar 1) Read log 2) Look in output window if you expect code to produce output 3) Problems  Bad syntax  Missing ; at end of line  Missing quote ’ at end of title (nasty!) Recommended steps!
  • 13. Improved output - HTML Tools → Options → Preferences→ Results Do this & resubmit code Check HTML output in Results Window  
  • 15. SAS data sets • SAS procedures (PROC … ) process data from SAS data sets • Need to know (briefly!) – What a SAS data set looks like – How to get out data into a SAS data set
  • 16. SAS data sets • live in libraries • have a descriptor part (with useful info) • have a data part which is a rectangular table of character and/or numeric data values (rows called observations) • have names with syntax <libname.>datasetname libname defaults to work if omitted
  • 17. work library SAS data sets with a single part name like oz, wp or mybestdata99 1) are stored in the work library 2) can be referenced e.g. as mybestdata99 or work.mybestdata99 3) are deleted at end of SAS session!
  • 18. Don’t loose your data! Keep the SAS program that read the data from its original source . . . More later!
  • 19. Viewing descriptor & data /* view descriptor part */ proc contents data = wp; run; /* view data part */ proc print data = work.wp; run; Alternatively: Use SAS Explorer: Open (for data) Properties (for descriptor) Properties is not as clear as CONTENTS
  • 20. SAS variables There are two types of variables: • character contain any value: letters, numbers, special characters, and blanks. Character values are stored with a length of 1 to 32,767 bytes (default is 8). One byte equals one character. • numeric stored as floating point numbers in 8 bytes of storage by default. Eight bytes of floating point storage provide space for 16 or 17 significant digits. You are not restricted to 8 digits. Don’t change the 8 byte length!
  • 21. SAS variables The CONTENTS Procedure Alphabetic List of Variables and Attributes # Variable Type Len 1 oz Char 8 2 rad Num 8 3 wt Num 8 OUTPUT
  • 22. SAS names – for data sets & variables • can be 32 characters long. • can be uppercase, lowercase, or mixed-case but are not case sensitive! • must start with a letter or underscore. Subsequent characters can be letters, underscores, or numeric digits - no %$!*&#@ or spaces.
  • 23. LastName FirstName JobTitle Salary TORRES JAN Pilot 50000 LANGKAMM SARAH Mechanic 80000 SMITH MICHAEL Mechanic . WAGSCHAL NADJA Pilot 77500 TOERMOEN JOCHEN 65000 A value must exist for every variable for each observation. Missing values are valid values. A numeric missing value is displayed as a period. A character missing value is displayed as a blank. Missing Data Values
  • 24. SAS syntax • Not case sensitive • Each ‘line’ usually begins with keyword and ends with ; • Common Errors: – Forget ; – Miss-spelt or wrong keyword – Missing final quote in title title ‘Woodpecker Habitat; /* quote mark missing */ title ‘Woodpecker Habitat’;
  • 25. Comments 1. Type /* to begin a comment. 2. Type your comment text. 3. Type */ to end the comment. • To comment selected typed text remember: Ctrl+/ • Alternative: * comment ;
  • 26. SAS Creating a SAS data set
  • 27. Getting data in! Consider 2 methods 1) Data in program (briefly!) 2) Data in Excel workbook
  • 28. Getting data in! Data in program file: data oz; input oz $ rad wt; datalines; Low 118.4 0.7 High 109.1 1.3 Low 215.2 2.9 . . . ; run; Note: 1. oz is text variable so requires $ 2. No missing values 3. Values of oz • don’t contain spaces • are at most 8 character long
  • 29. Getting data in! from Excel • Use IMPORT wizard saving program to reduce future clicking!
  • 30. Creating new variables Adding a new variable to an existing SAS data set (say work.old) 1. Use set 2. Give definition of new variable data new; /* read data from work.old */ set old; y2 = y**2; ly = log(y); ly_base10 = log10(y); t1 = (treat = 1); run;
  • 31. Data set: work.new Obs treat y ysquared logy logy_base10 t1 1 A 10.0 100.00 2.30259 1 0 2 A 100.0 10000.00 4.60517 2 0 3 B -10.0 100.00 . . 1 4 B 0.0 0.00 . . 1 5 B 0.1 0.01 -2.30259 -1 1
  • 33. Data Screening checking input data for gross errors • Use PRINT procedure to scan for obvious anomalies • Use MEANS procedure & examine summary table – MAXIMUM, MINIMUM – reasonable? – MEAN - near middle of range? – MISSING VALUES - input or calculation error e.g. log(0)? – CV (= 100*std.dev/mean) - < 10% for plant growth, between 12 & 30% for animal production variables, > 50% implies skewness for any positive variable
  • 34. Dealing with data errors • Check original records • Change mistakes in recording where the correct value is beyond question • Regenerate observations where possible – e.g. reweigh sample, redo chemical analysis • With a large body of data in an unbalanced design err on the side of omitting questionable data Do not proceed until data has been properly cleaned – if necessary perform a number of screening runs
  • 35. For More Information click below link: Follow Us on: http://vibranttechnologies.co.in/sas-classes-in-mumbai.html Thank You !!!

Editor's Notes

  1. Open wp.sas for illustration
  2. Do a few example using wp.sas
  3. Do demo with wp.sas – using contens and Explorer
  4. See program rd_oz.sas: Check long value for oz value with space
  5. Do demo using oz.xls