没有合适的资源?快使用搜索试试~ 我知道了~
SAS Certification Prep Guide: Base Programming for SAS 9
4星 · 超过85%的资源 需积分: 10 38 下载量 150 浏览量
2011-01-09
01:30:41
上传
评论
收藏 5.78MB PDF 举报
温馨提示
试读
564页
SAS Certification Prep Guide: Base Programming for SAS 9
资源推荐
资源详情
资源评论
SAS Certification Prep Guide: Base
Programming for SAS 9
2
Table of Contents
Chapter 1: Basic Concepts ...............................................................................7
Overview.....................................................................................................7
Introduction.............................................................................................7
Objectives................................................................................................7
SAS Programs .............................................................................................7
Components of SAS Programs...................................................................7
Characteristics of SAS Programs ................................................................8
Layout for SAS Programs ..........................................................................9
Processing SAS Programs..........................................................................9
Log Messages ........................................................................................10
Results of Processing..............................................................................10
SAS Libraries .............................................................................................13
How SAS Files Are Stored .......................................................................13
Storing Files Temporarily or Permanently .................................................14
Referencing SAS Files ................................................................................14
Two-Level Names...................................................................................14
Referencing Temporary SAS Files ............................................................15
Referencing Permanent SAS Files ............................................................15
Rules for SAS Names ..............................................................................16
SAS Data Sets ...........................................................................................16
Overview of Data Sets ............................................................................16
Descriptor Portion ..................................................................................17
Data Portion...........................................................................................17
Observations (Rows) ..............................................................................17
Variable Attributes .....................................................................................17
Name ....................................................................................................18
Type......................................................................................................18
Length...................................................................................................19
Format ..................................................................................................19
Informat ................................................................................................20
Label .....................................................................................................20
Variables (Columns) ...............................................................................21
Missing Values .......................................................................................21
Summary ..................................................................................................22
Text Summary .......................................................................................22
Points to Remember ...............................................................................23
Quiz..........................................................................................................24
Chapter 2: Referencing Files and Setting Options............................................28
Overview...................................................................................................28
Introduction...........................................................................................28
Objectives..............................................................................................28
Referencing Files .......................................................................................28
3
SAS Libraries..........................................................................................28
Assigning Librefs ....................................................................................28
Verifying Librefs .....................................................................................29
How Long Librefs Remain in Effect ..........................................................29
Specifying Two-Level Names...................................................................30
Other Formats........................................................................................30
Viewing the Contents of SAS Libraries.........................................................31
The CONTENTS Procedure ......................................................................32
The DATASETS Procedure.......................................................................34
Setting SAS System Options .......................................................................35
SAS Output ............................................................................................35
Handling Two-Digit Year Values: Year 2000 Compliance ...........................40
Viewing System Options.............................................................................44
The OPTIONS Procedure.........................................................................44
Additional System Options..........................................................................45
Summary ..................................................................................................46
Text Summary .......................................................................................46
Points to Remember ...............................................................................47
Quiz..........................................................................................................47
Chapter 3: Editing and Debugging SAS Programs............................................52
Overview...................................................................................................52
Introduction...........................................................................................52
Objectives..............................................................................................52
SAS Program Layout ..................................................................................52
Interpreting Error Messages .......................................................................53
Error Types............................................................................................53
Syntax Errors .........................................................................................53
Correcting Errors .......................................................................................54
Resubmitting a Revised Program .............................................................55
Resolving Common Problems......................................................................56
Missing RUN Statement ..........................................................................56
Missing Semicolon ..................................................................................57
Unbalanced Quotation Marks...................................................................58
Invalid Option ........................................................................................60
Additional Features ....................................................................................61
Comments in SAS Programs....................................................................61
SAS System Options ...............................................................................61
Summary ..................................................................................................62
Text Summary .......................................................................................62
Points to Remember ...............................................................................62
Quiz..........................................................................................................62
Chapter 4: Creating List Reports ....................................................................66
Overview...................................................................................................66
Introduction...........................................................................................66
4
Objectives..............................................................................................66
Types of Reports .......................................................................................66
Basic Report...........................................................................................66
Column Totals........................................................................................68
Sorting and Labels..................................................................................69
Selected Observations and Variables .......................................................70
Creating a Basic Report..............................................................................71
Selecting Observations ...........................................................................72
Removing the OBS Column .....................................................................74
Identifying Observations ............................................................................74
Example ................................................................................................75
Selecting Observations...............................................................................76
Specifying WHERE Expressions................................................................78
Using the CONTAINS Operator ................................................................78
Specifying Compound WHERE Expressions...............................................78
Examples of WHERE Statements .............................................................78
Sorting Data..............................................................................................79
Example ................................................................................................79
Generating Column Totals ..........................................................................81
Requesting Subtotals..............................................................................82
Creating a Customized Layout with BY Groups and ID Variables ................84
Requesting Subtotals on Separate Pages .................................................85
Double-Spacing Listing Output....................................................................87
Specifying Titles and Footnotes ..................................................................87
TITLE and FOOTNOTE Statements ..........................................................88
Modifying and Canceling Titles and Footnotes ..........................................90
Assigning Descriptive Labels.......................................................................91
Temporarily Assigning Labels to Variables................................................91
Formatting Data Values..............................................................................93
Temporarily Assigning Formats to Variables .............................................93
Specifying SAS Formats ..........................................................................94
Using Permanently Assigned Labels and Formats.........................................96
Additional Features ....................................................................................97
Summary ..................................................................................................97
Text Summary .......................................................................................97
Points to Remember ...............................................................................99
Quiz........................................................................................................100
Chapter 5: Creating SAS Data Sets from Raw Data........................................107
Overview.................................................................................................107
Introduction.........................................................................................107
Objectives............................................................................................107
Raw Data Files ........................................................................................107
Steps to Create a SAS Data Set ................................................................108
Referencing a SAS Library ........................................................................109
5
Using a LIBNAME Statement .................................................................109
Referencing a Raw Data File.....................................................................109
Using a FILENAME Statement................................................................109
Referencing a Fully Qualified Filename...................................................111
Referencing a File in an Aggregate Storage Location ..............................111
Writing a DATA Step Program...................................................................111
Naming the Data Set ............................................................................111
Specifying the Raw Data File.................................................................112
Column Input.......................................................................................113
Describing the Data..............................................................................114
Submitting the DATA Step Program ..........................................................116
Verifying the Data ................................................................................116
Checking DATA Step Processing ............................................................117
Listing the Data Set ..............................................................................118
Reading the Entire Raw Data File ..........................................................119
Invalid Data .........................................................................................119
Creating and Modifying Variables..............................................................121
SAS Expressions ...................................................................................122
Using Operators in SAS Expressions ......................................................122
More Examples of Assignment Statements .............................................123
Date Constants ....................................................................................124
Subsetting Data.......................................................................................125
Reading Instream Data ............................................................................126
Example ..............................................................................................127
Steps to Create a Raw Data File ...............................................................128
Using the_NULL_ Keyword....................................................................128
Specifying the Raw Data File.................................................................129
Describing the Data..............................................................................129
Additional Features ..................................................................................130
Summary ................................................................................................131
Text Summary .....................................................................................131
Points to Remember .............................................................................132
Quiz........................................................................................................133
Chapter 6: Understanding DATA Step Processing ..........................................140
Overview.................................................................................................140
Introduction.........................................................................................140
Objectives............................................................................................140
Writing Basic DATA Steps.........................................................................140
How SAS Processes Programs...................................................................142
Compilation Phase ...................................................................................142
Input Buffer .........................................................................................142
Program Data Vector ............................................................................143
Syntax Checking...................................................................................143
Data Set Variables................................................................................143
剩余563页未读,继续阅读
资源评论
- lkbwx2014-06-25这个玩意儿非常好
jessieli0571
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功