SlideShare a Scribd company logo
SAS tutorial
     2012/09/27
Institute of Cognitive Science
             許景淳
  E-mail : honli1027@gmail.com
Outline
Input Data
     1. Column mode
     2. List Mode
     3. Formatted mode
Syntax of input data
                       Construct the SAS
DATA XXX;              data set
INPUT A B C D;           Input the names
                         of variables
CARDS;
Put your data here        Input data
;

PROC PRINT;
                       Code of the task you
RUN;                   want SAS to do
Name of the SAS data set
• DATA XXX
1. We can’t use number as the first letter
   of the name

2. There can’t be a blank in the name

3. Use different name for each data set
Type of the variables
1. word:NAME, SEX
   We should use $ to claim that it’s a word
   type variable

2. number:ID, AGE, INCOME,RT…
• DATA procedure
  – To construct or modify the SAS data


• PROC procedure
  – Process the SAS data


• Feature of SAS code
  – (1) use ; as the end of each row
  – (2) you can use capital or small letter
  – (3) SAS code can be in the same row or cross
        a lot of rows
Input the Data
• Use each way to input this data

number        height      weight    age
    1          170           65     23
    2          158           40     20
    3          163           51     18
1. column mode



         Assign the locations
         where the data begin
Feature of Column Input
• SAS use the assigned locations to read data, so
  the data should be at the assigned locations

• The blank can be included in the word type
  variables

• The missing data can be represented by .
  or blank
• disadvantages:
     – If the data exceed the assigned locations, it will be
       correspond to the wrong variable
               Number           Age           Rank
     – i.e       001            18              1
                 002            20              2



correct



wrong
2. List Mode
Feature of List Input
• There should be blank between each data

• The blank can’t be included in the word type
  variables

• The only way to represent the missing data
  is .
3. Formatted mode




         Assign the locations
         where the data begin,
         and the length of data
Feature of Formatted Input
• SAS use the assigned locations and the length
  to read data, so the data should be at the
  assigned locations and correct length

• The blank can be included in the word type
  variables

• The missing data can be represented by .
  or blank
• 缺點:
     – If the data exceed the assigned length, SAS will
       filter it
                Name           Age           Rank
     – i.e       Tom            18             1
                Mary            20             2



correct



wrong
Fro example

name height weight      age   sex

Tom     170   65        23    M

Jimmy   158   40        20    F

Mary    163   51        18    M
欄位讀取法


  Name and sex are word
  type variables, so we
  have to use $
簡列讀取法
格式讀取法
• We can see that

  – When the length of data is unequal, column mode
    and formatted mode are inconvenient

  – Instead, when we use list mode, we can simply
    use blank to separate data, so we usually use this
    mode to input data
summary
• Column mode
  – Have to calculate the locations and the missing
    data can be represented by . or blank

• List mode
  – Easy to use and the missing data only can be
    represented by .

• Formatted mode
  – Have to calculate the length and the missing data
    can be represented by . or blank
END

More Related Content

What's hot

Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
Arun Sharma
 
Processing data using regular expressions
Processing data using regular expressionsProcessing data using regular expressions
Processing data using regular expressions
Gordon Morrison
 
Normalization
NormalizationNormalization
Normalization
Salman Memon
 
Entity relationship diagram - Concept on normalization
Entity relationship diagram - Concept on normalizationEntity relationship diagram - Concept on normalization
Entity relationship diagram - Concept on normalization
Satya Pal
 
Ch10
Ch10Ch10
Ch10
蕭美蓮
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Oum Saokosal
 
Bcnf
BcnfBcnf
Ibps it officer exam capsule by affairs cloud
Ibps it officer exam capsule by affairs cloudIbps it officer exam capsule by affairs cloud
Ibps it officer exam capsule by affairs cloud
affairs cloud
 
Normalization in a Database
Normalization in a DatabaseNormalization in a Database
Normalization in a Database
Bishrul Haq
 
Normalization PRESENTATION
Normalization PRESENTATIONNormalization PRESENTATION
Normalization PRESENTATION
bit allahabad
 
Learn Normalization in simple language
Learn Normalization in simple languageLearn Normalization in simple language
Learn Normalization in simple language
FirstWire Apps
 
Normalization Accepted
Normalization AcceptedNormalization Accepted
Normalization Accepted
prasaddurga
 

What's hot (12)

Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
Processing data using regular expressions
Processing data using regular expressionsProcessing data using regular expressions
Processing data using regular expressions
 
Normalization
NormalizationNormalization
Normalization
 
Entity relationship diagram - Concept on normalization
Entity relationship diagram - Concept on normalizationEntity relationship diagram - Concept on normalization
Entity relationship diagram - Concept on normalization
 
Ch10
Ch10Ch10
Ch10
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
 
Bcnf
BcnfBcnf
Bcnf
 
Ibps it officer exam capsule by affairs cloud
Ibps it officer exam capsule by affairs cloudIbps it officer exam capsule by affairs cloud
Ibps it officer exam capsule by affairs cloud
 
Normalization in a Database
Normalization in a DatabaseNormalization in a Database
Normalization in a Database
 
Normalization PRESENTATION
Normalization PRESENTATIONNormalization PRESENTATION
Normalization PRESENTATION
 
Learn Normalization in simple language
Learn Normalization in simple languageLearn Normalization in simple language
Learn Normalization in simple language
 
Normalization Accepted
Normalization AcceptedNormalization Accepted
Normalization Accepted
 

Viewers also liked

0306大腦與行為
0306大腦與行為0306大腦與行為
0306大腦與行為景淳 許
 
0603記憶
0603記憶0603記憶
0603記憶
zhenxun
 
1011 sas 實習課
1011 sas 實習課1011 sas 實習課
1011 sas 實習課景淳 許
 
0927 sas實習課
0927 sas實習課0927 sas實習課
0927 sas實習課景淳 許
 
研究方法&工具
研究方法&工具研究方法&工具
研究方法&工具
景淳 許
 
0603記憶
0603記憶0603記憶
0603記憶
zhenxun
 
服務設計Ncku2013
服務設計Ncku2013服務設計Ncku2013
服務設計Ncku2013景淳 許
 
10/04 SAS 實習課
10/04 SAS 實習課10/04 SAS 實習課
10/04 SAS 實習課
景淳 許
 
2013 感性工學概述
2013  感性工學概述2013  感性工學概述
2013 感性工學概述景淳 許
 
11/01 SAS 快速複習
11/01 SAS 快速複習11/01 SAS 快速複習
11/01 SAS 快速複習景淳 許
 
什麼是記憶銀行?
什麼是記憶銀行?什麼是記憶銀行?
什麼是記憶銀行?
yt Chen
 
1012大腦與行為
1012大腦與行為1012大腦與行為
大腦當家BrainRules
大腦當家BrainRules大腦當家BrainRules
大腦當家BrainRules
Ida Wu
 

Viewers also liked (20)

0320記憶(2)
0320記憶(2)0320記憶(2)
0320記憶(2)
 
1207記憶II
1207記憶II1207記憶II
1207記憶II
 
0306大腦與行為
0306大腦與行為0306大腦與行為
0306大腦與行為
 
0603記憶
0603記憶0603記憶
0603記憶
 
1011 sas 實習課
1011 sas 實習課1011 sas 實習課
1011 sas 實習課
 
Open data
Open dataOpen data
Open data
 
0927 sas實習課
0927 sas實習課0927 sas實習課
0927 sas實習課
 
研究方法&工具
研究方法&工具研究方法&工具
研究方法&工具
 
意識
意識意識
意識
 
0313學習
0313學習0313學習
0313學習
 
0603記憶
0603記憶0603記憶
0603記憶
 
服務設計Ncku2013
服務設計Ncku2013服務設計Ncku2013
服務設計Ncku2013
 
10/04 SAS 實習課
10/04 SAS 實習課10/04 SAS 實習課
10/04 SAS 實習課
 
2013 感性工學概述
2013  感性工學概述2013  感性工學概述
2013 感性工學概述
 
11/01 SAS 快速複習
11/01 SAS 快速複習11/01 SAS 快速複習
11/01 SAS 快速複習
 
什麼是記憶銀行?
什麼是記憶銀行?什麼是記憶銀行?
什麼是記憶銀行?
 
1012大腦與行為
1012大腦與行為1012大腦與行為
1012大腦與行為
 
通識心理_0409記憶
通識心理_0409記憶通識心理_0409記憶
通識心理_0409記憶
 
1012發展心理學
1012發展心理學1012發展心理學
1012發展心理學
 
大腦當家BrainRules
大腦當家BrainRules大腦當家BrainRules
大腦當家BrainRules
 

Similar to 0927 sas english version

ADBMS Unit-II b
ADBMS Unit-II bADBMS Unit-II b
spss_beginners.pptx
spss_beginners.pptxspss_beginners.pptx
spss_beginners.pptx
far_927
 
Access
AccessAccess
Lawson Microsoft Addins
Lawson Microsoft AddinsLawson Microsoft Addins
Lawson Microsoft Addins
Nogalis Inc
 
Sas short course_presentation_11-4-09
Sas short course_presentation_11-4-09Sas short course_presentation_11-4-09
Sas short course_presentation_11-4-09
Prashant Ph
 
Sas short course_presentation_11-4-09
Sas short course_presentation_11-4-09Sas short course_presentation_11-4-09
Sas short course_presentation_11-4-09
Prashant Ph
 
SQL-1.pptx for database system and system query language
SQL-1.pptx for database system  and system query languageSQL-1.pptx for database system  and system query language
SQL-1.pptx for database system and system query language
ironman82715
 
Python strings presentation
Python strings presentationPython strings presentation
Python strings presentation
VedaGayathri1
 
spss_beginners_0.ppt
spss_beginners_0.pptspss_beginners_0.ppt
spss_beginners_0.ppt
VanessaChristonetteS1
 
spss_beginners_0.ppt
spss_beginners_0.pptspss_beginners_0.ppt
spss_beginners_0.ppt
AbhinavShrivastava87
 
spss_beginners_0.ppt
spss_beginners_0.pptspss_beginners_0.ppt
spss_beginners_0.ppt
sohaib zafar
 

Similar to 0927 sas english version (11)

ADBMS Unit-II b
ADBMS Unit-II bADBMS Unit-II b
ADBMS Unit-II b
 
spss_beginners.pptx
spss_beginners.pptxspss_beginners.pptx
spss_beginners.pptx
 
Access
AccessAccess
Access
 
Lawson Microsoft Addins
Lawson Microsoft AddinsLawson Microsoft Addins
Lawson Microsoft Addins
 
Sas short course_presentation_11-4-09
Sas short course_presentation_11-4-09Sas short course_presentation_11-4-09
Sas short course_presentation_11-4-09
 
Sas short course_presentation_11-4-09
Sas short course_presentation_11-4-09Sas short course_presentation_11-4-09
Sas short course_presentation_11-4-09
 
SQL-1.pptx for database system and system query language
SQL-1.pptx for database system  and system query languageSQL-1.pptx for database system  and system query language
SQL-1.pptx for database system and system query language
 
Python strings presentation
Python strings presentationPython strings presentation
Python strings presentation
 
spss_beginners_0.ppt
spss_beginners_0.pptspss_beginners_0.ppt
spss_beginners_0.ppt
 
spss_beginners_0.ppt
spss_beginners_0.pptspss_beginners_0.ppt
spss_beginners_0.ppt
 
spss_beginners_0.ppt
spss_beginners_0.pptspss_beginners_0.ppt
spss_beginners_0.ppt
 

More from 景淳 許

2010淺談日本新產品開發之感心技術s
2010淺談日本新產品開發之感心技術s2010淺談日本新產品開發之感心技術s
2010淺談日本新產品開發之感心技術s景淳 許
 
20130318 社群網路與人工智慧
20130318 社群網路與人工智慧20130318 社群網路與人工智慧
20130318 社群網路與人工智慧
景淳 許
 
Class 1 f_mri_intro
Class 1 f_mri_introClass 1 f_mri_intro
Class 1 f_mri_intro
景淳 許
 
0220課程介紹(1)
0220課程介紹(1)0220課程介紹(1)
0220課程介紹(1)景淳 許
 
0227心理學史簡介
0227心理學史簡介0227心理學史簡介
0227心理學史簡介景淳 許
 
SAS 11/01
SAS 11/01SAS 11/01
SAS 11/01
景淳 許
 

More from 景淳 許 (6)

2010淺談日本新產品開發之感心技術s
2010淺談日本新產品開發之感心技術s2010淺談日本新產品開發之感心技術s
2010淺談日本新產品開發之感心技術s
 
20130318 社群網路與人工智慧
20130318 社群網路與人工智慧20130318 社群網路與人工智慧
20130318 社群網路與人工智慧
 
Class 1 f_mri_intro
Class 1 f_mri_introClass 1 f_mri_intro
Class 1 f_mri_intro
 
0220課程介紹(1)
0220課程介紹(1)0220課程介紹(1)
0220課程介紹(1)
 
0227心理學史簡介
0227心理學史簡介0227心理學史簡介
0227心理學史簡介
 
SAS 11/01
SAS 11/01SAS 11/01
SAS 11/01
 

Recently uploaded

OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 

Recently uploaded (20)

OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 

0927 sas english version

  • 1. SAS tutorial 2012/09/27 Institute of Cognitive Science 許景淳 E-mail : honli1027@gmail.com
  • 2. Outline Input Data 1. Column mode 2. List Mode 3. Formatted mode
  • 3. Syntax of input data Construct the SAS DATA XXX; data set INPUT A B C D; Input the names of variables CARDS; Put your data here Input data ; PROC PRINT; Code of the task you RUN; want SAS to do
  • 4. Name of the SAS data set • DATA XXX 1. We can’t use number as the first letter of the name 2. There can’t be a blank in the name 3. Use different name for each data set
  • 5. Type of the variables 1. word:NAME, SEX We should use $ to claim that it’s a word type variable 2. number:ID, AGE, INCOME,RT…
  • 6. • DATA procedure – To construct or modify the SAS data • PROC procedure – Process the SAS data • Feature of SAS code – (1) use ; as the end of each row – (2) you can use capital or small letter – (3) SAS code can be in the same row or cross a lot of rows
  • 7. Input the Data • Use each way to input this data number height weight age 1 170 65 23 2 158 40 20 3 163 51 18
  • 8. 1. column mode Assign the locations where the data begin
  • 9.
  • 10. Feature of Column Input • SAS use the assigned locations to read data, so the data should be at the assigned locations • The blank can be included in the word type variables • The missing data can be represented by . or blank
  • 11. • disadvantages: – If the data exceed the assigned locations, it will be correspond to the wrong variable Number Age Rank – i.e 001 18 1 002 20 2 correct wrong
  • 13.
  • 14. Feature of List Input • There should be blank between each data • The blank can’t be included in the word type variables • The only way to represent the missing data is .
  • 15. 3. Formatted mode Assign the locations where the data begin, and the length of data
  • 16.
  • 17. Feature of Formatted Input • SAS use the assigned locations and the length to read data, so the data should be at the assigned locations and correct length • The blank can be included in the word type variables • The missing data can be represented by . or blank
  • 18. • 缺點: – If the data exceed the assigned length, SAS will filter it Name Age Rank – i.e Tom 18 1 Mary 20 2 correct wrong
  • 19. Fro example name height weight age sex Tom 170 65 23 M Jimmy 158 40 20 F Mary 163 51 18 M
  • 20. 欄位讀取法 Name and sex are word type variables, so we have to use $
  • 23. • We can see that – When the length of data is unequal, column mode and formatted mode are inconvenient – Instead, when we use list mode, we can simply use blank to separate data, so we usually use this mode to input data
  • 24. summary • Column mode – Have to calculate the locations and the missing data can be represented by . or blank • List mode – Easy to use and the missing data only can be represented by . • Formatted mode – Have to calculate the length and the missing data can be represented by . or blank
  • 25. END