lecture10数据循环处理.ppt

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

Chapter 10 Processing of Data Iteratively 10、数据循环处理 Contents Section 10.1 Using a Simple DO Loop to Process Data Section 10.2 Performing Operations on Similar Variables Section 10.3 Performating Calculation Until a Condition is met Section 10.4 Sampling a SAS Data Set at Random Section 10.1 Using a Simple DO Loop to Process Data Objectives Understand DO loop processing. Eliminate redundant code. Introduction DO loops can be used in a variety of ways. You can perform repetitive calculations generate data eliminate redundant code execute SAS code conditionally read data. Scenario The MIS Department wants to reduce the amount of written code that produces a data set showing the employees’ 5% raises over the next three years. Original Program for WORK.RAISES DO Loop Syntax General form of a simple iterative DO loop: DO Loop Syntax DO Loop Syntax Expressions: do z = k to n/10; Dates: do date = 01JAN2002d to 31JAN2002d; DO Loop Syntax General form of a DO loop with a value list: The values in the list can be numeric or character. DO Loop Syntax Discrete numeric values separated by commas: do n = 1,5,15,30,60; Character values enclosed in quotes and separated by commas: do month = JAN,FEB,MAR; Modified Program for WORK.RAISES Generating Random Number Repetitively This demonstration illustrates how to use a random number generator to produce random weekday, month, and year by using DO LOOP and OUTPUT statement. Section 10.2 Performing Operations on Similar Variables Objectives Create arrays. Use arrays to perform operations on similar variables. Use arrays to create new variables. Scenario An employee contributes to a charity every month. International Airlines contributes an additional 25% of the employee’s contribution. Calculate the company’s contribution to the employee’s charity. Determine the company’s percentage of each quarterly contribution. IA.EMP_CONTRIB WORK.COMP_CONTRIB Need for Array Processing Uses for SAS Arra

文档评论(0)

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

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

1亿VIP精品文档

相关文档