Hi, Here is a simple macro I have written for what you are looking for. you need to input follwing parameters. Input dataset name, output dataset name, first column name, last column name, total columns. %macro temp(in /* input dataset name*/ ,out /* output dataset name */ ,firstcol /* name of first column */ ,lastcol /* name of last column */ ,total /* numbe of total columns */); data &out; set ∈ array sel{&total} &firstcol.--&lastcol.; do i=1 to &total; if sel{i} ne . then do; X=sel{i}; end; end; drop i; run; %mend temp; %temp(data1,data2,x1,x4,4); /* this is example */ Pelase let me know if it works for you. Message was edited by: Sagar rana
... View more