This preview shows page 1. Sign up to view the full content.
Unformatted text preview: whether or not the constraining value passed from the criteria
selection data set is put between quote marks.
A partial comparison statement is in the column labeled SQL_Rule Later we append the value from the
criteria selection data set to the SQL_Rule to make a valid statement. Display 5. The Excel Rules Master Workbook, Inclusion Worksheet 6 SAS Global Forum 2013 Foundations and Fundamentals This next code reads the Inclusion Rules worksheet in the Excel Rules Master workbook. A LIBNAME statement with
the Excel Engine lets us reference multiple worksheets from one workbook, which the code generator needs to do
because there is one sheet per Word table. After reading all three worksheets we combine the data into a single
rulesBase data set.
libname xls excel "&_rulesExcelWorkBook";
%** Create a dataset containing inclusion rules. ;
attrib id length=$10 informat=$10. format=$10.;
attrib target_table_field_name length=$30 informat=$30. format=$30.;
attrib business_name length=$75 informat=$75. format=$75.;
attrib if_condition length=$150. informat=$150. format=$150.;
attrib data_type length=$4 informat=$4. format=$4. ;
attrib sql_rule length=$100 informat=$100. format=$100.;
attrib audit_type_code length=8 informat=3. format=3.;
if sql_rule ne ''; %** Dont read blank rows. keep id target_table_field_name business_name data_type sql_rule
So now we have five datasets.
One general information data set from which we create macro variables;
Three criteria selection data sets from the Requirements Document; and
One data set from the Excel Rules workbook that contains a partial SQL statement for each of the criteria.
Now the datasets are sorted and merged by record ID. In the code below, the variable whereCriteria holds a
value that appends the constraining value of the requirement to the partial comparision string from the rulesBase.
The dataset notInRulesBase serves as a check to see that new criteria was...
View Full Document
This test prep was uploaded on 03/30/2014 for the course CGS 1000 at Hillsborough.