This macro takes a variable and a format as input. If the format is not specified (checked by the external macro %AHGblank), it uses the 'best.' format. It then applies the format via the `put` function and left-aligns the result with `left`. It is designed to be used in DATA steps or SQL procedures.
Data Analysis
Type : CREATION_INTERNE
String processing macro, does not depend on external data tables.
1 Code Block
MACRO
Explanation : Definition of the %ahgputn macro. It first checks if the format parameter is empty via the %AHGblank call. If so, it forces the 'best.' format. Then, it generates SAS code combining the `left` and `put` functions to format the value and remove leading spaces.
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.