[工学]SAS Workshop.ppt

  1. 1、本文档共39页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
[工学]SAS Workshop

SAS Data Management SAS Workshop SAS Data Management Outline INPUT Statement: Input Styles INFILE Statement PROC IMPORT/EXPORT Data Manipulation IF…ELSE DO…END Clauses Recode Variables LABEL and RENAME Variables Select Observations Variables Working with Data Sets SAS DATA SOURCES DATA STEP DATA steps read and manipulate data. INPUT tells how SAS reads data. DATALINES indicates data items to be read begin from the next line. INFILE reads data from an external file. LIBNAME sm ‘c:\temp\sas’; DATA sm.grade0; INPUT name $ id stat math; DATALINES; John 10091 89 95 … RUN; INPUT STATEMENT There are six input styles. List INPUT: simply list variable names Modified list INPUT: for ill-organized data Column INPUT: location of data items Formatted INPUT: format of data items Named INPUT: variable=data Mixed INPUT: combine input styles SAS recognizes styles automatically. List (previous slide), column, and formatted INPUT are commonly used. COLUMN INPUT Specify column locations of data items $ follows a character variable name Data should be aligned correctly Some data may be skipped (id below) DATA sm.grade1; INPUT name $ 1-6 stat 12-14 math 15-17; DATALINES; John 10091 89 95 Rachel10100 99 … RUN; FORMATTED INPUT Specify formats of data items. Data should be aligned correctly. $6. means a string 6 characters long. 3.0 or 3. means a 3 digit number without a decimal point. DATA sm.grade2; INPUT name $6. id 5. male 3. stat 3.0; DATALINES; John 10091 89 95 Rachel10100 99 … COLUMN CONTROLS @n moves the input pointer to the nth column. +n shifts the input pointer by n column to the right. You may skip some variables (e.g., id) INPUT name $6. +5 stat 3. @15 math 3.; DATALINES; John 10091 89 95 Rachel10100 99 … LINE CONTROLS @ and @@ trailing hold input records INPUT name $ stat math @@; DATALINES; John 89 95 Ron 76 100 #n moves the input pointer to nth line, / moves the input pointer to the next line INPUT name $6. #2 stat 3. / math 3.; DATALINES; John 89 95

文档评论(0)

qiwqpu54 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档