Okay, I have a tricky issue and hope for some help. I have two datasets, one (data1) which has values as data and one (data2) which has field names and relational operators which whom I want to check the data in the first dataset. For instance: Dataset data1: obs Field1 Field2 Field3 1 3 5 UT 2 0 12 XX3 ... Dataset data2: obs rule_no operand1 rel_oper operand2 1 r1 Field1 > 0 2 r2 Field3 = UT 3 r3 Field1 <= Field2 ... I seek to execute the validation rules of data2 on data1 and thus have to resolve operand1, rel_oper and operand2 on the fly if they are fieldnames of data1. For instance if I wand to check the rule in obs 3 of data2 on ob1 of data1 I would expect: 3 <= 5 My first idea was to use a hash to lookup on the validation rules like: data test; attrib ...; if _n_ eq 1 then do dcl hash data2(dataset: 'data2') data2.definekey('rule_no'); data2.definedata('operand1','rel_oper','operand2'); data2.definedone(); call missing(operand1,rel_oper,operand2); end; set data1; rule_no = r3; rc = data2.find(); now I somehow try to manage to resolve the value of the field name I get from the hash. run; Maybe there is a better Solution to my problem?
... View more