%ARMGTID Macro

Assigns a unique identifier to a transaction class.
Category: ARM Macro

Syntax

%ARMGTID (TXNNAME='transaction-name' < option-1 <, ...option-n>> );

Required Argument

TXNNAME='transaction-name'
is a transaction name. The value is a SAS character variable or quoted literal value.
Restriction:The transaction name has a 127-character limit.

Optional Arguments

APPID=numeric variable or constant
is the application ID to use on the ARM_GETID function call. The value must be a numeric variable or constant.
Note:Use APPIDVAR= instead of APPID= in new applications. APPID= is obsolete.
APPIDVAR=numeric variable
is the application ID. The value must be a numeric variable.
LEVEL=numeric constant or variable
is a variable that specifies the execution level. The value must be a numeric constant or variable.
MACONLY=NO | YES
enables the %ARMINIT macro to be issued in open code, outside of a DATA step. You set the value to YES if the macro can be issued in open code, and NO if it can be issued only in a DATA step.
Default:NO
METRNAM1–7='name'
is the name of the user-defined metric. The value must be a SAS character variable or quoted literal value.
Requirement:The name and user-defined metric definition must be specified.
METRDEF1–7=option
is the definition of the user-defined metric. The value must be one of the following:
COUNT32, COUNT64, or COUNTDIV
use the counter to sum the values of an interval. A counter can calculate average values, maximums, and minimums per transaction, and other statistics.
GAUGE32, GAUGE64, or GAUGEDIV
use the gauge when a sum of values is not needed. A gauge can calculate average values, maximums, and minimums per transaction, and other statistics.
ID32 or ID64
use the numeric ID as an identifier, but not as a measurement value. A numeric might be an error code or an employee ID. No calculations can be performed on the numeric ID.
SHORTSTR or LONGSTR
use the string ID as an identifier. No calculations can be performed on the string ID.
Restriction:METRDEF7= can equal only LONGSTR and can be a long string of 32 bytes. METRDEF1–6= cannot equal LONGSTR.
Requirement:The user name and user-defined metric definition must be specified.
SCL=NO | YES
is used only in SCL programs and specifies whether the macro is in an SCL environment. Set the value to YES if the macro is in an SCL environment, and NO if it is not.
Default:NO
TXNDET='name'
is a transaction detail. The value is a SAS character variable or quoted literal.
Restriction:The transaction detail has a 127-character limit.
TXNIDVAR=numeric variable
is a numeric variable that contains the value of the transaction ID.

Details

Use the %ARMGTID macro to name a transaction class. Transaction classes are related units of work within an application. One or more %ARMGTID macros are typically issued when the application starts to name each of the transaction classes used by the application. The %ARMGTID macro produces only one record for each transaction class, even if there are multiple %ARMGTID macros for the same transaction class.
The input is an application ID that is generated by a previous %ARMINIT macro. If the APPID= or APPIDVAR= option is provided, the specified value is used as the application ID. Otherwise, the value of the global macro variable _ARMAPID used.
The output is the _ARMTXID variable, which is the transaction class ID that was returned from the ARM_GETID function call. Any variable for the TXNIDVAR= option is updated.

Examples

Example 1: Basic Usage

data _null_;
  %armgtid(txnname='txn OE', txndet='Order Entry txn class');
run;

Example 2: Saving the Transaction ID

%let _armexec=1;
%let _armacro=1;
data _null_;
  %arminit(appname=application-name, appuser='sasxyz');
  %armgtid(txnname='txn OE', txndet='Order Entry txn class',
            txnidvar=txn1);
  put “transaction id is “ txn1;
run;