Hi, I have codes like below and I have to do it twenty times.I wonder whether there is a loop solution to make it faster. Let me explain the structure of my data: the file name "revtota_0305" contains name of variable and time period. I have 4 different variables (revtota, inttota, sgatota, cogstota) and 5 time period (0305, 0608, 0911, 1214, 1517) proc sort data=mal2.revtota_0305 nodupkey out=mal2.revtota_0305;
by company CUSIP SIC ISIN SEDOL;
run;
proc transpose data=mal2.revtota_0305 out=mal2.revtota_0305;
var
_2003 _2004 _2005;
by company CUSIP SIC ISIN SEDOL;
run;
data mal2.revtota_0305;
set mal2.revtota_0305;
date=substr(left(_NAME_),2,4);
Year=date*1;
rename COL1=revtota;
drop _NAME_ date;
run;
PROC SQL;
CREATE TABLE mal2.revtota_0305_trans AS
SELECT Company,
CUSIP,
SIC,
ISIN,
SEDOL,
Year,
revtota
FROM mal2.revtota_0305 t1;
QUIT;
... View more