Hi, try like this:
data have;
infile cards4 dlm = "|";
input order_id :$ order_detail :$ 100.;
cards4;
O1|;product1;3000;7020.00,;product2;2000;1340.00,product7;100;1220.00
O2|;product3;5;No Charge,;product4;25;No Charge
O3|;product3;5;500.00,;product4;15;No Charge
;;;;
run;
data want;
set have;
_N_ = countw(order_detail,",");
put _N_=;
do _N_ = 1 to _N_;
part = scan(order_detail, _N_, ",");
drop part order_detail;
Product = scan(part,1,";");
Units = input(scan(part,2,";"),best32.);
Price = input(scan(part,3,";"),??best32.)<>0;
output;
end;
run;
proc print;
run;
Bart
... View more