{"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}
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.