- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Dynamic Generation of Data Steps动态生成数据的步骤
June 11, 2010 TASS Dynamic Generation of Data Steps on basis of Unique By-Group Permutations Dynamic Generation of Data Steps on basis of Unique By-Group Permutations David Rosenfeld City of Toronto the data the problem a solution the macro the output the conclusion Overview data tass_sample; input division $10. score; label score=Test Score; cards; Division_A 1 Division_B 2 Division_B 8 Division_B 7 Division_B 6 Division_A 5 ; The Data need to export separate worksheets for each division the task has to be repeated every week don’t know which divisions will be in the data file don’t want to hardcode (and have to change) the program every week The Problem dynamically produce the desired datasets use subsetting criteria based on the values of a ‘by’ variable A Solution * Create a Macro to: derived from sample 26140/kb/26/140.html %macro groups(dsn,byvar,export_to); /* First sort the data in order of the */ /* by variable */ proc sort data=dsn.; by byvar.; run; The Macro %macro groups(dsn,byvar,export_to); /* First sort the data in order of the */ /* by variable */ proc sort data=dsn.; by byvar.; run; The Macro /* Then, create a macro variable, VARn, for */ /* each BY-Group and a counter of the number */ /* of new macro variables created. */ data _null_; set dsn. end=eof; by byvar.; if first.byvar. then do; flag+1; call symput(var||put(flag,8. -L),byvar.); end; if eof then call symput(tot,put(flag,8. -L)); run; %macro groups(dsn,byvar,export_to); /* First sort the data in order of the */ /* by variable */ proc sort data=dsn.; by byvar.; run; The Macro /* Then, create a macro variable, VARn, for */ /* each BY-Group and a counter of the number */ /* of new macro variables created.
您可能关注的文档
- Biases and Debiasing - Society to Improve Diagnosis in Medicine消除社会偏见和提高医学诊断.ppt
- BIAS project偏差项目.ppt
- Bias-Variance Analysis of Ensemble Learning - Oregon State 偏差,方差分析的集成学习-俄勒冈州.ppt
- Billing for Nurse Practitioners医生护士的帐单.ppt
- Binary Data Storage and Manipulation二进制数据的存储和操作.ppt
- Binary Representation - Transforming Numerical Methods 二进制表示形式转换的数值方法.ppt
- Binding Energy - Vernon Kids结合能量-弗农的孩子.ppt
- Binding Theory结合理论.ppt
- BIO 4118 Applied Biostatistics4118应用生物统计学生物.ppt
- Binomial Random Variables - Instructional Web Server -二项随机变量——教学的Web服务器—.ppt
- Dynamic Graphics动态图形.ppt
- Dynamic Firewalls and Service Deployment Models for Grid 网格的动态防火墙和服务的部署模型.ppt
- Dynamic Equilibrium - NUI Galway National University of Ireland 动态平衡高威的爱尔兰国立大学.ppt
- Dynamic Instruction Issue动态指令的问题.ppt
- Dynamic Matrix Control - Introduction动态矩阵控制-简介.ppt
- Dynamic Memory Allocation (DMA) - Amazon S3动态内存分配(DMA)-亚马逊S.ppt
- Dynamic Memory Allocationppt动态内存allocationppt.ppt
- Dynamic Memory Allocation I - HMC Computer Science动态内存分配我- HMC的计算机科学.ppt
- Dynamic Millimetre Wave Communications in the Presence of Rain在雨的存在动态毫米波通信.ppt
- Dynamic Modeling - II动态模型- II.ppt
原创力文档


文档评论(0)