How do Use Proc SQL to Extract Rolling Column files more efficiency ?
Hi ! Sir :
For SAS I am begginger ,Recently I used the tradional method (Proc SQL) to extract Rolling Columns files every 24 columns
from MONTHLY.xlsx file,I find my code is too long and to solw, Can you improve my code which became more efficiency ?
My Object is like the example's JPG file,those files will be involved from H199101 H199102 ... and to H201103.
Thank for your helps !
*Start from 199101*
%_eg_conditional_dropds(WORK.H199101);
PROC SQL;
CREATE TABLE WORK.H199101 AS
SELECT t1.IND,
t1.'199101'n AS K1,
t1.'199102'n AS K2,
t1.'199103'n AS K3,
t1.'199104'n AS K4,
t1.'199105'n AS K5,
t1.'199106'n AS K6,
t1.'199107'n AS K7,
t1.'199108'n AS K8,
t1.'199109'n AS K9,
t1.'199110'n AS K10,
t1.'199111'n AS K11,
t1.'199112'n AS K12,
t1.'199201'n AS K13,
t1.'199202'n AS K14,
t1.'199203'n AS K15,
t1.'199204'n AS K16,
t1.'199205'n AS K17,
t1.'199206'n AS K18,
t1.'199207'n AS K19,
t1.'199208'n AS K20,
t1.'199209'n AS K21,
t1.'199210'n AS K22,
t1.'199211'n AS K23,
t1.'199212'n AS K24
FROM WORK.MONTHLY t1;
QUIT;
*End to 201103*
%_eg_conditional_dropds(WORK.H201103);
PROC SQL;
CREATE TABLE WORK.H201103 AS
SELECT t1.IND,
t1.'201103'n AS K1,
t1.'201104'n AS K2,
t1.'201105'n AS K3,
t1.'201106'n AS K4,
t1.'201107'n AS K5,
t1.'201108'n AS K6,
t1.'201109'n AS K7,
t1.'201110'n AS K8,
t1.'201111'n AS K9,
t1.'201112'n AS K10,
t1.'201201'n AS K11,
t1.'201202'n AS K12,
t1.'201203'n AS K13,
t1.'201204'n AS K14,
t1.'201205'n AS K15,
t1.'201206'n AS K16,
t1.'201207'n AS K17,
t1.'201208'n AS K18,
t1.'201209'n AS K19,
t1.'201210'n AS K20,
t1.'201211'n AS K21,
t1.'201212'n AS K22,
t1.'201301'n AS K23,
t1.'201302'n AS K24
FROM WORK.MONTHLY t1;
QUIT;