/* Richard A. DeVenezia * www.devenezia.com */ /* This was originally sent in private mail * and was posted to SAS-L with permission by Chang Chung * on Oct. 25, 2003 * The thread was subject "Splitting up values" */ /* Problem: * A DATA set contains a character variable which is the * result of delimited concatenation of several variables * no longer present. * The original variables and their values would like to be * restored by deconstructing the concatenated value. */ %* %* Some concatenate values that will need deconstructing %*; data one; master="15231_._1_0_00_0_2_N_0_5_3_-21914__END"; output; master="66666_._1_0_00_0_2_N_0_5_3_-21914__END"; output; run; %* %* Stuff the values into the _infile_ buffer and %* INPUT as if reading from a file. %* Note: A DATA Step only has an _infile_ buffer available to %* it when there is a real input occurring, thus the CARDS %* statement being a necessary evil %*; data two; * cause _infile_ to be available; infile cards dlm='_' missover; input @; * input from value of variable master after it has been * placed in the _infile_ buffer; length var1-var20 $8; do while (not eod); set one end=eod; _infile_ = master; input @1 var1-var20 @; output; end; stop; cards4; necessary evil ;;;; run;