You can decide what scope you want a variable to have in a transaction by specifying the scope as an attribute of the %DEFINE statement. You can specify
To specify transaction scope for a variable:
Specify the attribute STATIC to indicate that the variable has transaction scope, meaning the value of the variable is saved across all invocations in a transaction. STATIC is the default for persistent macros. For example:
@dtw_static() %define(static) var1 = "val1"
To specify single invocation scope for a variable:
Specify the attribute TRANSIENT to indicate that the variable has single invocation scope, meaning the value of the variable will be re-initialized on each invocation. TRANSIENT is the default for non-persistent macros. For example:
@dtw_static() %define(transient) var1 = "val1"
In a persistent macro: