使用可变参数技术开发SAS®标准宏

Lei Zhang
{"title":"使用可变参数技术开发SAS®标准宏","authors":"Lei Zhang","doi":"10.1179/175709206X373019","DOIUrl":null,"url":null,"abstract":"AbstractA macro that can take more or fewer arguments when it is called than formally declared is often referred to as a variable argument (or varargs) macro. The SAS® macro facility provides a basic mechanism for constructing a varargs macro. When properly developed, a single varargs macro can be used to solve arrays of problems of the same form all together in an orderly and uniform way, which can be especially valuable to the development of standard macros used in pharmaceutical programming. This article first describes the way to define a typical varargs macro using the option PBUFF in the %Macro statement, as well as two simulated methods. It then explores common calling conventions for varargs macros and various approaches to implementing varargs macros based on how individual arguments can be retrieved from varargs lists passed at runtime. In addition, the advantages and disadvantages of using varargs macros are briefly discussed, and the techniques are illustrated with various examples.","PeriodicalId":253012,"journal":{"name":"Pharmaceutical Programming","volume":"116 2 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2008-12-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Developing SAS® standard macros with variable argument techniques\",\"authors\":\"Lei Zhang\",\"doi\":\"10.1179/175709206X373019\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"AbstractA macro that can take more or fewer arguments when it is called than formally declared is often referred to as a variable argument (or varargs) macro. The SAS® macro facility provides a basic mechanism for constructing a varargs macro. When properly developed, a single varargs macro can be used to solve arrays of problems of the same form all together in an orderly and uniform way, which can be especially valuable to the development of standard macros used in pharmaceutical programming. This article first describes the way to define a typical varargs macro using the option PBUFF in the %Macro statement, as well as two simulated methods. It then explores common calling conventions for varargs macros and various approaches to implementing varargs macros based on how individual arguments can be retrieved from varargs lists passed at runtime. In addition, the advantages and disadvantages of using varargs macros are briefly discussed, and the techniques are illustrated with various examples.\",\"PeriodicalId\":253012,\"journal\":{\"name\":\"Pharmaceutical Programming\",\"volume\":\"116 2 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2008-12-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Pharmaceutical Programming\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1179/175709206X373019\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Pharmaceutical Programming","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1179/175709206X373019","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

摘要

在调用时可以接受比正式声明的更多或更少参数的宏通常被称为可变参数宏。SAS®宏工具提供了构建变量宏的基本机制。如果开发得当,可以使用单个变量宏以有序和统一的方式解决相同形式的问题数组,这对于开发制药编程中使用的标准宏尤其有价值。本文首先描述了在% macro语句中使用选项PBUFF定义典型变量宏的方法,以及两个模拟方法。然后,根据如何从运行时传递的可变变量列表中检索单个参数,探讨可变变量宏的常见调用约定和实现可变变量宏的各种方法。此外,还简要讨论了使用变量宏的优点和缺点,并通过各种示例说明了这些技术。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Developing SAS® standard macros with variable argument techniques
AbstractA macro that can take more or fewer arguments when it is called than formally declared is often referred to as a variable argument (or varargs) macro. The SAS® macro facility provides a basic mechanism for constructing a varargs macro. When properly developed, a single varargs macro can be used to solve arrays of problems of the same form all together in an orderly and uniform way, which can be especially valuable to the development of standard macros used in pharmaceutical programming. This article first describes the way to define a typical varargs macro using the option PBUFF in the %Macro statement, as well as two simulated methods. It then explores common calling conventions for varargs macros and various approaches to implementing varargs macros based on how individual arguments can be retrieved from varargs lists passed at runtime. In addition, the advantages and disadvantages of using varargs macros are briefly discussed, and the techniques are illustrated with various examples.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信