Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mp_rowhash.sas File Reference

Iterative row-level MD5 hash generator. More...

Go to the source code of this file.

Detailed Description

Generates DATA step statements that compute a deterministic, row-level MD5 hash using a Merkle-style construction. Each variable is hashed independently and the resulting raw 16-byte digests are combined iteratively. This avoids concatenating the per-variable hex digests into a single SAS character expression, which overflows when datasets contain many variables.

Temporary variables use five leading underscores.

This macro is called from inside a DATA step. The caller is responsible for declaring the output hash column if it does not already exist on the input dataset.

Variables are hashed in the order supplied. If a particular variable needs to influence the hash first (for example the previous row hash in mp_hashdataset, or business dates in Data Controller's bitemporal loader) simply list it first in cvars or nvars.

Parameters
[in]md5_col=Name of the output hash column.
[in]cvars=Space separated list of character variables to hash.
[in]nvars=Space separated list of numeric variables to hash.
Version
9.3M5
Author
Allan Bowe

Definition in file mp_rowhash.sas.