Published on :
Macro CREATION_INTERNE

AHGhashvalue Macro - Hash Value Retrieval

This code is also available in: Deutsch Español Français
This utility macro simulates an associative array (hash) using macro variables. It takes a hash identifier and a key (handle), determines the key's index via the external macro %AHGindex, then dynamically constructs the name of the variable containing the value to return it.
Data Analysis

Type : CREATION_INTERNE


The processing relies exclusively on the manipulation of macro variables and parameters provided at call time. No SAS data table is read or written.

1 Code Block
MACRO
Explanation :
Declares local variables, calculates the key's index via %AHGindex, retrieves the corresponding value through indirect macro variable resolution, and returns this value.
Copied!
1%macro AHGhashvalue(hashid,handle);
2 %local idx out;
3 %let indx=%AHGindex(&&&hashid.list,&handle);
4 %let out=&&&hashid&indx;
5 &out
6%mend;
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.