%BRM_IMPORT_RULESET

Imports rule sets from the specified CSV file into the rules database.

Restrictions: This macro must be run on the server tier.
The same user can run any of import macros at the same time. However, multiple users cannot run the same import macro simultaneously.

Syntax

%BRM_IMPORT_RULESET (CSV=input_filename.CSV,
REJECT=reject_filename.CSV<, options>);

Required Arguments

CSV=input_filename

specifies the full pathname to the CSV file where you want to import the data from. For more information, see Format of Rule Set CSV Input File.

REJECT=reject_filename

specifies the full pathname to the CSV file where you want the macro to write any records that were not imported to the rules database. See Using the %BRM_IMPORT_RULESET Macro for more information.

Optional Arguments

BRM_USER=user_ID

specifies the user ID that you want to be associated with the data that is imported. This user ID is associated with the imported objects in the rules database and is displayed in the SAS Business Rules Manager interface.

Default User ID of the user that is running the macro

BYPASSLOCK=Y|N

enables you to override the lock that another user has on the importing process. See Using the %BRM_IMPORT_RULESET Macro for more information.

Default N

Details

Using the %BRM_IMPORT_RULESET Macro

The %BRM_IMPORT_RULESET macro enables you to add new rule sets and to update existing rule sets. The macro uses the rule set name and rule set path to determine whether a rule set already exists. If the rule set path and name already exist, then the rule set is updated. If the rule set path exists but the rule set name does not exist, the rule set is created. If the rule set path does not exist, then the rule set is rejected.
The %BRM_IMPORT_RULESET macro runs several validation checks as it imports the rule sets. For example, it verifies that the expressions are valid, ensures that the first rule in each rule set uses the IF operator, and verifies that the specified vocabularies exist. If the macro finds a validation error in a rule set, it writes a message to the SAS log, and the rule set is rejected. The macro writes the input records for the rejected rule set and the reason that the record was rejected to the CSV file that was specified in the REJECT= option.
When you run the %BRM_IMPORT_RULESET macro, it creates a lock table in the rules database named lock_import_rule_set. The SAS log states which user holds the lock and the time at which the lock started. This lock might remain in place after the macro has finished. If this happens, you can override the lock by specifying the BYPASSLOCK=Y option when you run the macro.

Format of Rule Set CSV Input File

Each row of the CSV input file specifies a rule, rule set, term, and an expression for that term. The row also specifies whether the expression is a condition expression or an action expression. Each row of the input file can specify only one condition expression or one action expression for a given rule. The CSV file must contain all of the columns that are listed in the following table, in the order listed. You must specify values for all columns, except as noted in the table. To create a blank column in the CSV file, specify two comma separators without any content between them. For example, to add a rule to the rule set named assignRisk that uses the loanVocab vocabulary and to specify a blank column for the rule set description, specify the following in the CSV file:
assignRisk,,loanVocab
Format of the Rule Set CSV Input File
Column
Description
Can Column Be Blank
RULE_SET_SK
The identification number of the rule set.
Yes
RULE_SET_NM
The name of the rule set where you want to add the rule that is specified in RULE_NM.
No
RULE_SET_DESC
The description of the rule set.
Yes
VOCAB_NM
The name of the vocabulary that the rule set uses. All rules in the same rule set must use the same vocabulary.
No
RULE_SET_PATH
The pathname to the business rules folder for the rule set. This path must exist. Separate folder names with forward slashes.
No
RULE_NM
The name of the rule to be added to the rule set.
No
RULE_DESC
The description of the rule.
Yes
RULE_SEQ_NO
The order number for the rule that is in the rule set. Order numbers in a rule set start with 1.
No
CONDITIONAL_NM
The operator for the rule. Specify if, elseif, or or. The first rule in a rule set must use the if operator.For information about these operators, see Controlling Which Conditions Are Evaluated in SAS Business Rules Manager: User's Guide.
No
RECORD_RULE_FIRED_FLG
Specifies whether a rule-fired record is created when the condition for the rule identified in the RULE_NM field evaluates to True. Specify Y or N. If you specify N, a rule-fired record is not created regardless of what the condition evaluates to.
No
LHS_TERM
The term for the expression specified in the EXPRESSION column. Terms that are specified in the LHS_TERM column are the terms that SAS Business Rules Manager displays at the top or left side of the decision table. These terms appear in the column headings of the decision table when you are viewing the decision table in the horizontal format. They appear in the row headings of the decision table when you are viewing the decision table in the vertical format.
No
EXPRESSION
A single condition or action expression for the term specified in the LHS_TERM column. This expression is the expression that you would enter into a cell in the decision table. See Defining New Rules in the Rule Set in SAS Business Rules Manager: User's Guide for more information about expressions.
Yes
EXPRESSION_ORDER
The order number of the rule’s condition or action expressions. A rule’s condition and action expressions are numbered beginning with 1. For example, a rule might have two condition expressions that are numbered 1 and 2, and it might have three action expressions that are numbered 1, 2, and 3.
No
EXPRESSION_TYPE
The type of expression. Specify condition or action.
No