%BRM_IMPORT_RULESET

Imports rule sets from the specified CSV file into the SAS Decision Manager database.

Requirements: The vocabulary used by the rule set must exist.
This macro must be run on the server tier.
CAUTION:
If the server is running in lockdown mode, you should not edit input files that are generated by the %BRM_EXPORT_RULESET macro before you import the data.
If the input file contains errors, the database might become corrupted. See Locked-Down Servers in SAS Intelligence Platform: Security Administration Guide and LOCKDOWN Statement in SAS Intelligence Platform: Application Server Administration Guide for more information.

Syntax

%BRM_IMPORT_RULESET (CSV=%STR(input_filename.CSV),
REJECT=%STR(reject_filename.CSV)<, BRM_USER=user_ID>
<, OVERWRITE=Y|N><, LOCK=Y|N>);

Required Arguments

CSV=%STR(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=%STR(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 SAS Decision Manager 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 SAS Decision Manager database and is displayed in the interface.

Default User ID of the user that is logged on to the server and running the macro

LOCK=Y|N

specifies whether to lock the imported rule set.

Default N

OVERWRITE=Y|N

specifies whether existing rule sets can be updated. If you specify N, the updates are rejected.

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 pathname to determine whether a rule set already exists. If the rule set pathname and name already exist, then the rule set is updated. If the rule set pathname exists but the rule set name does not exist, the rule set is created. If the rule set pathname 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.
Rule sets that you import with the %BRM_IMPORT_RULESET macro are imported as unlocked versions. Before you can publish rule flows that contain the imported rule sets, you must lock the rule sets.

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, the following two lines add a rule to the rule set named riskSet, which uses the Loan_Vocab vocabulary. The first line adds the condition term CondTerm and assigns to it the expression <5000. The second line adds the action term ActionTerm and assigns to it the expression 'Bad'.
.,riskSet,,Loan_Vocab,Loans/Retail,RuleName1,,1,if,Y,CondTerm,<5000,1,CONDITION
.,riskSet,,Loan_Vocab,Loans/Retail,RuleName1,,1,if,Y,ActionTerm,'Bad',1,ACTION
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 pathname 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 Decision 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 condition and action terms for the rule set. In the rule set editor, these terms appear in the Term column in the list view. They appear as column headings in the horizontal view and as row headings in the vertical view.
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 rule set editor. Enclose character strings in quotation marks. To specify a missing expression, enter a period and an underscore (._).See Defining New Rules in the Rule Set in SAS Decision 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
Last updated: February 22, 2017