Novis, trying to learn IML. In the program below, I am trying to pick the LBN values which satisfies low - high range, create output dataset test1 as subset of test which satisfy this condition in most efficient way (without listing all of the variables). Thanks. proc iml ; use test; read all var _NUM_ into x[c=NumVar]; close test; r_x=nrow(x); c_x=ncol(x); /* Lab date variable d */ lbn = x[, 'd']; /*Upper Lower limits for week 100 boundaries*/ low = x[, 'const'] + 2; high = x[, 'const'] + 15; outc = x[,'s']; /* outc = j(nrow(s), 1); */ idx = loc (lbn <= high & lbn >= low ); y=j(nrow()); if ncol (idx)> 0 then y[idx]=x; print x , y; print satisfy "Criteria Met"; print (lbn[idx])[label='lab date'] , (low[idx]) [label='lowb'], (high[idx]) [label='highb'], [label='test']; create TEST1 from y ; append from y; close test1; quit;
... View more