SlideShare a Scribd company logo
1 of 37
BAS 150
Lesson 6:
Combining and Subsetting Data & SAS Arrays
• Create subsets of data
• Combine two or more data sets
• Utilize knowledge of SAS arrays
This Lesson’s Learning Objectives
Subsetting Data Sets
Subsetting Datasets
IF WHERE
Data step only Not used with RAW
data in data step
Reading in RAW
data
SAS datasets
Inside a PROC
statement
• Do the same thing
• Applied in different places
Rules for If & Where
Subsetting Datasets Cont.
Subsetting If
The Where Statement (1 of 2)
Operator Description Example Matches
IS
MISSING
Matches a missing
value
where gender is missing; A missing character value
IS NULL Equivalent to IS
MISSING
where age is null; A missing numeric value
BETWEEN
AND
An inclusive range where age between 20 and 40; All values between 20
and 40, including 20 and
40
CONTAINS Matches a substring where name contains 'MAC'; MACON, IMMACULATE
LIKE Matching with
wildcards
where name like 'R_N%'; RON, RONALD, RUN,
RUNNING
=* Phonetic matching where name =* 'NICK'; NICK, NACK, NIKKI
WHERE statement allows for additional operators
The Where Statement (2 of 2)
Combining Data Sets
(Joins & Merges)
Joins and Merges
 MERGE
 Joins
o One-to-one
o One-to-many
o Inner
o Excluding
One-to-One Joins (1 of 2)
Student_ID Quiz1
001 85
002 86
003 95
004 97
Student_ID Quiz2
001 96
002 88
003 85
004 94
One-to-One Joins (2 of 2)
Student_ID Quiz1 Quiz2
001 85 96
002 86 88
003 95 85
004 97 94
One-to-Many Joins (1 of 2)
Student_ID Gender
001 F
002 M
003 M
004 F
Student_ID Course_Title
001 Psychology 101
001 Philosophy 105
001 Math 212
002 Writing 222
002 Psychology 101
002 Spanish 301
… …
One-to-Many Joins (2 of 2)
Student_ID Gender Course_Title
001 F Psychology 101
001 F Philosophy 105
001 F Math 212
002 M Writing 222
002 M Psychology 101
002 M Spanish 301
… … …
MERGE Statement (1 of 3)
PersQuiz
SocQuiz
CogQuiz
MERGE Statement (2 of 3)
MERGE Statement (3 of 3)
Inner Joins (1 of 3)
Inner Joins (2 of 3)
Inner Joins (3 of 3)
Excluding Joins (1 of 2)
Excluding Joins (2 of 2)
SAS Arrays
 Collection of elements defined as a single group
 Allow us to write SAS statements referencing a
group of variables.
 Different than arrays in many other programming
languages.
SAS Array
Example
Example Array (1 of 2)
Example Array (2 of 2)
ARRAY array-name {subscript} <$> <length> <array-
elements> <(initial-value-list)>;
Array Statement
ARRAY array-name {subscript} array-elements;
More Examples of Arrays (1 of 2)
More Examples of Arrays (2 of 2)
* and Dim()
Creating Character Variables
Temporary Arrays (1 of 2)
 Do loop
 Exists only in data step
 Storing constant values
Temporary Arrays (2 of 2)
• Create subsets of data
• Combine two or more data sets
• Utilize knowledge of SAS arrays
Summary - Learning Objectives
“This workforce solution was funded by a grant awarded by the U.S. Department of Labor’s
Employment and Training Administration. The solution was created by the grantee and does not
necessarily reflect the official position of the U.S. Department of Labor. The Department of Labor
makes no guarantees, warranties, or assurances of any kind, express or implied, with respect to such
information, including any information on linked sites and including, but not limited to, accuracy of the
information or its completeness, timeliness, usefulness, adequacy, continued availability, or ownership.”
Except where otherwise stated, this work by Wake Technical Community College Building Capacity in
Business Analytics, a Department of Labor, TAACCCT funded project, is licensed under the Creative
Commons Attribution 4.0 International License. To view a copy of this license, visit
http://creativecommons.org/licenses/by/4.0/
Copyright Information

More Related Content

What's hot (20)

SQL : introduction
SQL : introductionSQL : introduction
SQL : introduction
 
Sql ppt
Sql pptSql ppt
Sql ppt
 
2 data structure in R
2 data structure in R2 data structure in R
2 data structure in R
 
Intro to t sql – 3rd session
Intro to t sql – 3rd sessionIntro to t sql – 3rd session
Intro to t sql – 3rd session
 
Chapter2
Chapter2Chapter2
Chapter2
 
Relational data model
Relational data modelRelational data model
Relational data model
 
Advanced data structures vol. 1
Advanced data structures   vol. 1Advanced data structures   vol. 1
Advanced data structures vol. 1
 
Sql.pptx
Sql.pptxSql.pptx
Sql.pptx
 
Sql Basics And Advanced
Sql Basics And AdvancedSql Basics And Advanced
Sql Basics And Advanced
 
Base SAS Statistics Procedures
Base SAS Statistics ProceduresBase SAS Statistics Procedures
Base SAS Statistics Procedures
 
Introduction to SAS
Introduction to SASIntroduction to SAS
Introduction to SAS
 
6. R data structures
6. R data structures6. R data structures
6. R data structures
 
Exemplo arquivo arff
Exemplo arquivo arffExemplo arquivo arff
Exemplo arquivo arff
 
Sql fundamentals
Sql fundamentalsSql fundamentals
Sql fundamentals
 
Data Preprocessing
Data PreprocessingData Preprocessing
Data Preprocessing
 
Intro To TSQL - Unit 5
Intro To TSQL - Unit 5Intro To TSQL - Unit 5
Intro To TSQL - Unit 5
 
Tree representation in map reduce world
Tree representation  in map reduce worldTree representation  in map reduce world
Tree representation in map reduce world
 
Introduction to sas
Introduction to sasIntroduction to sas
Introduction to sas
 
Indexing
IndexingIndexing
Indexing
 
2005 fall cs523_lecture_4
2005 fall cs523_lecture_42005 fall cs523_lecture_4
2005 fall cs523_lecture_4
 

Viewers also liked

SAS Ron Cody Solutions for even Number problems from Chapter 7 to 15
SAS Ron Cody Solutions for even Number problems from Chapter 7 to 15SAS Ron Cody Solutions for even Number problems from Chapter 7 to 15
SAS Ron Cody Solutions for even Number problems from Chapter 7 to 15Ayapparaj SKS
 
Where Vs If Statement
Where Vs If StatementWhere Vs If Statement
Where Vs If StatementSunil Gupta
 
BAS 150 Lesson 5 Lecture
BAS 150 Lesson 5 LectureBAS 150 Lesson 5 Lecture
BAS 150 Lesson 5 LectureWake Tech BAS
 
Learning SAS With Example by Ron Cody :Chapter 16 to Chapter 20 Solution
Learning SAS With Example by Ron Cody :Chapter 16 to Chapter 20 SolutionLearning SAS With Example by Ron Cody :Chapter 16 to Chapter 20 Solution
Learning SAS With Example by Ron Cody :Chapter 16 to Chapter 20 SolutionVibeesh CS
 
SAS Ron Cody Solutions for even Number problems from Chapter 16 to 20
SAS Ron Cody Solutions for even Number problems from Chapter 16 to 20SAS Ron Cody Solutions for even Number problems from Chapter 16 to 20
SAS Ron Cody Solutions for even Number problems from Chapter 16 to 20Ayapparaj SKS
 
BAS 150 Lesson 2 Lecture
BAS 150 Lesson 2 Lecture BAS 150 Lesson 2 Lecture
BAS 150 Lesson 2 Lecture Wake Tech BAS
 

Viewers also liked (7)

SAS Ron Cody Solutions for even Number problems from Chapter 7 to 15
SAS Ron Cody Solutions for even Number problems from Chapter 7 to 15SAS Ron Cody Solutions for even Number problems from Chapter 7 to 15
SAS Ron Cody Solutions for even Number problems from Chapter 7 to 15
 
Where Vs If Statement
Where Vs If StatementWhere Vs If Statement
Where Vs If Statement
 
BAS 150 Lesson 5 Lecture
BAS 150 Lesson 5 LectureBAS 150 Lesson 5 Lecture
BAS 150 Lesson 5 Lecture
 
Learning SAS With Example by Ron Cody :Chapter 16 to Chapter 20 Solution
Learning SAS With Example by Ron Cody :Chapter 16 to Chapter 20 SolutionLearning SAS With Example by Ron Cody :Chapter 16 to Chapter 20 Solution
Learning SAS With Example by Ron Cody :Chapter 16 to Chapter 20 Solution
 
BAS 250 Lecture 5
BAS 250 Lecture 5BAS 250 Lecture 5
BAS 250 Lecture 5
 
SAS Ron Cody Solutions for even Number problems from Chapter 16 to 20
SAS Ron Cody Solutions for even Number problems from Chapter 16 to 20SAS Ron Cody Solutions for even Number problems from Chapter 16 to 20
SAS Ron Cody Solutions for even Number problems from Chapter 16 to 20
 
BAS 150 Lesson 2 Lecture
BAS 150 Lesson 2 Lecture BAS 150 Lesson 2 Lecture
BAS 150 Lesson 2 Lecture
 

Similar to BAS 150 Lesson 6 Lecture

Similar to BAS 150 Lesson 6 Lecture (20)

Sas array statement
Sas array statementSas array statement
Sas array statement
 
Sas summary guide
Sas summary guideSas summary guide
Sas summary guide
 
Sas cheat
Sas cheatSas cheat
Sas cheat
 
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
 
Intro to T-SQL – 2nd session
Intro to T-SQL – 2nd sessionIntro to T-SQL – 2nd session
Intro to T-SQL – 2nd session
 
SAS - Training
SAS - Training SAS - Training
SAS - Training
 
Annotating search results from web databases-IEEE Transaction Paper 2013
Annotating search results from web databases-IEEE Transaction Paper 2013Annotating search results from web databases-IEEE Transaction Paper 2013
Annotating search results from web databases-IEEE Transaction Paper 2013
 
AnzoGraph DB - SPARQL 101
AnzoGraph DB - SPARQL 101AnzoGraph DB - SPARQL 101
AnzoGraph DB - SPARQL 101
 
Data structure.pptx
Data structure.pptxData structure.pptx
Data structure.pptx
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
 
SPARQL
SPARQLSPARQL
SPARQL
 
Analytics with SAS
Analytics with SASAnalytics with SAS
Analytics with SAS
 
Pandas csv
Pandas csvPandas csv
Pandas csv
 
Intermediate Perl
Intermediate PerlIntermediate Perl
Intermediate Perl
 
23. SQL and Database.pdf
23. SQL and Database.pdf23. SQL and Database.pdf
23. SQL and Database.pdf
 
Lecture 2a arrays
Lecture 2a arraysLecture 2a arrays
Lecture 2a arrays
 
MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
 
23. SQL and Database.pdf
23. SQL and Database.pdf23. SQL and Database.pdf
23. SQL and Database.pdf
 
SQL | DML
SQL | DMLSQL | DML
SQL | DML
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
 

More from Wake Tech BAS

BAS 150 Lesson 8 Lecture
BAS 150 Lesson 8 LectureBAS 150 Lesson 8 Lecture
BAS 150 Lesson 8 LectureWake Tech BAS
 
BAS 150 Lesson 7 Lecture
BAS 150 Lesson 7 LectureBAS 150 Lesson 7 Lecture
BAS 150 Lesson 7 LectureWake Tech BAS
 
BAS 150 Lesson 3 Lecture
BAS 150 Lesson 3 LectureBAS 150 Lesson 3 Lecture
BAS 150 Lesson 3 LectureWake Tech BAS
 
BAS 150 Lesson 1 Lecture
BAS 150 Lesson 1 LectureBAS 150 Lesson 1 Lecture
BAS 150 Lesson 1 LectureWake Tech BAS
 

More from Wake Tech BAS (9)

BAS 250 Lecture 8
BAS 250 Lecture 8BAS 250 Lecture 8
BAS 250 Lecture 8
 
BAS 250 Lecture 4
BAS 250 Lecture 4BAS 250 Lecture 4
BAS 250 Lecture 4
 
BAS 250 Lecture 3
BAS 250 Lecture 3BAS 250 Lecture 3
BAS 250 Lecture 3
 
BAS 250 Lecture 2
BAS 250 Lecture 2BAS 250 Lecture 2
BAS 250 Lecture 2
 
BAS 250 Lecture 1
BAS 250 Lecture 1BAS 250 Lecture 1
BAS 250 Lecture 1
 
BAS 150 Lesson 8 Lecture
BAS 150 Lesson 8 LectureBAS 150 Lesson 8 Lecture
BAS 150 Lesson 8 Lecture
 
BAS 150 Lesson 7 Lecture
BAS 150 Lesson 7 LectureBAS 150 Lesson 7 Lecture
BAS 150 Lesson 7 Lecture
 
BAS 150 Lesson 3 Lecture
BAS 150 Lesson 3 LectureBAS 150 Lesson 3 Lecture
BAS 150 Lesson 3 Lecture
 
BAS 150 Lesson 1 Lecture
BAS 150 Lesson 1 LectureBAS 150 Lesson 1 Lecture
BAS 150 Lesson 1 Lecture
 

Recently uploaded

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Recently uploaded (20)

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

BAS 150 Lesson 6 Lecture

  • 1. BAS 150 Lesson 6: Combining and Subsetting Data & SAS Arrays
  • 2. • Create subsets of data • Combine two or more data sets • Utilize knowledge of SAS arrays This Lesson’s Learning Objectives
  • 5. IF WHERE Data step only Not used with RAW data in data step Reading in RAW data SAS datasets Inside a PROC statement • Do the same thing • Applied in different places Rules for If & Where
  • 9. Operator Description Example Matches IS MISSING Matches a missing value where gender is missing; A missing character value IS NULL Equivalent to IS MISSING where age is null; A missing numeric value BETWEEN AND An inclusive range where age between 20 and 40; All values between 20 and 40, including 20 and 40 CONTAINS Matches a substring where name contains 'MAC'; MACON, IMMACULATE LIKE Matching with wildcards where name like 'R_N%'; RON, RONALD, RUN, RUNNING =* Phonetic matching where name =* 'NICK'; NICK, NACK, NIKKI WHERE statement allows for additional operators The Where Statement (2 of 2)
  • 11. Joins and Merges  MERGE  Joins o One-to-one o One-to-many o Inner o Excluding
  • 12. One-to-One Joins (1 of 2) Student_ID Quiz1 001 85 002 86 003 95 004 97 Student_ID Quiz2 001 96 002 88 003 85 004 94
  • 13. One-to-One Joins (2 of 2) Student_ID Quiz1 Quiz2 001 85 96 002 86 88 003 95 85 004 97 94
  • 14. One-to-Many Joins (1 of 2) Student_ID Gender 001 F 002 M 003 M 004 F Student_ID Course_Title 001 Psychology 101 001 Philosophy 105 001 Math 212 002 Writing 222 002 Psychology 101 002 Spanish 301 … …
  • 15. One-to-Many Joins (2 of 2) Student_ID Gender Course_Title 001 F Psychology 101 001 F Philosophy 105 001 F Math 212 002 M Writing 222 002 M Psychology 101 002 M Spanish 301 … … …
  • 16. MERGE Statement (1 of 3) PersQuiz SocQuiz CogQuiz
  • 19. Inner Joins (1 of 3)
  • 20. Inner Joins (2 of 3)
  • 21. Inner Joins (3 of 3)
  • 25.  Collection of elements defined as a single group  Allow us to write SAS statements referencing a group of variables.  Different than arrays in many other programming languages. SAS Array
  • 29. ARRAY array-name {subscript} <$> <length> <array- elements> <(initial-value-list)>; Array Statement ARRAY array-name {subscript} array-elements;
  • 30. More Examples of Arrays (1 of 2)
  • 31. More Examples of Arrays (2 of 2)
  • 34. Temporary Arrays (1 of 2)  Do loop  Exists only in data step  Storing constant values
  • 36. • Create subsets of data • Combine two or more data sets • Utilize knowledge of SAS arrays Summary - Learning Objectives
  • 37. “This workforce solution was funded by a grant awarded by the U.S. Department of Labor’s Employment and Training Administration. The solution was created by the grantee and does not necessarily reflect the official position of the U.S. Department of Labor. The Department of Labor makes no guarantees, warranties, or assurances of any kind, express or implied, with respect to such information, including any information on linked sites and including, but not limited to, accuracy of the information or its completeness, timeliness, usefulness, adequacy, continued availability, or ownership.” Except where otherwise stated, this work by Wake Technical Community College Building Capacity in Business Analytics, a Department of Labor, TAACCCT funded project, is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ Copyright Information

Editor's Notes

  1. .