Hello, What is the best solution for scanning a formula without getting in the output - c(I) columns (I = 1,2,3..) a. Null values (for example in the available data we have C3 and C4 with null values) b. Duplicate values (for example X1 appears twice in the second line of have data ) c. Digits (the digit 2 was dropped succesfully from available data ) Thanks. Data Have ; infile datalines dsd ; input formula : $30. ; datalines ; X1 / X2 + X4 (X1 + X2) / (X3 - X1) * 2 ; Run ; data Available ; set Have ; delims = '+-/*()' ; Array ccc_ [10] $32 c1-c10 ; do i = 1 to 10 ; if countc(scan(formula, i, delims),'X') > 0 ccc_[i] = scan(formula, i, delims) ; end ; drop delims i ; run ; Data Want ; infile datalines dsd ; input C1 $3. C2 $3. C3 $3. ; datalines ; X1 X2 X4 X1 X2 X3 ; Run ;
... View more