Data selected notinrulesbase length value 25 merge

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: n’t added to the Requirements Document without the Excel Rules base being updated. A later check not shown compares the count of the number of selected criteria in the Requirements Document with the number of records in the selected data set. If the counts don’t match, the process aborts. data selected notInRulesBase; length value $25; merge rulesBase(in=inBase keep=id sql_rule dataType) standardInclusions(in=selectedSI keep=id value rename=(value=valueSI)) binaryStandardExclusions(in=selectedBSE keep=id) valueStandardExclusions(in=selectedVSE keep=id value rename=(value=valueVSE)); by id; if inBase and (selectedSI or selectedBSE or selectedVSE); %** Assign Value based on data source. ; if selectedSI then value=valueSI; else if selectedBSE then value=''; else if selectedVSE then value=valueVSE; %** Put quotes around list elements and character and date variables. ; if lowcase(dataType) in ('char' 'date') and value ne '' then do; if index(sql_rule,'in') then do; needsParens=1; comma=indexc(value,','); if comma=0 then value="'"||trim(value)||"'"; else value="'"||tranwrd(compress(value),",","','")||"'"; end; else do; value="'"||value||"'"; end; 7 SAS Global Forum 2013 Foundations and Fundamentals end; %** Derive where criteria. ; if value='' then whereCriteria=sql_rule; else if needsParens = 1 then do; whereCriteria=catx(' ',sql_rule,'(',value,')'); end; else whereCriteria=catx(' ',sql_rule,value); %** Create two variables for sorting so code will be in Reqs Doc order. ; %** Now sorted by ID, the order of the rules will be ascending--ESB, ESV, IS. ; %** So we have to work with it a bit. ; if substr(id,3,1) in ('B' 'V') then do; if substr(id,1,3)='ESV' then charID='ESA'; else charID=substr(id,1,3); numID=substr(id,4); end; else do; charID=substr(id,1,2); numID=substr(id,3); end; %** output to notInRulesBase if the rule isnt in Rules Master. ; if inBase and (selectedSI or selectedBSE or selectedVSE) then output selected; else if selectedSI or selectedBSE or sele...
View Full Document

Ask a homework question - tutors are online