This script defines the `%AHGtran` macro. Its purpose is to isolate variables (`var`, `colvar`, `ordvar`) from a source table (`dsn`) into a temporary table (whose name is generated by `%AHGgettempname`). Once the table is prepared, it calls another macro, `%AHGfreeloop`, to perform iterative processing (likely transposition or dynamic code generation). The script includes an example call on `sashelp.class`.
Data Analysis
Type : SASHELP
The execution example uses the standard `sashelp.class` table. The macro is generic and can accept any SAS table as input.
1 Code Block
DATA STEP Data
Explanation : Macro definition. It encapsulates a Data Step to reduce the input table to only the necessary variables, then calls the `%AHGfreeloop` macro for processing.
Explanation : Invocation of the `AHGtran` macro using the `sashelp.class` table, with `height` as the analysis variable and `sex` as the column variable.
Copied!
%AHGtran(sashelp.class,height,sex);
1
%AHGtran(sashelp.class,height,sex);
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.