proc sql; create table step_1 as select * from master where date = '200101'; run; proc sql; create table step_2 as select * from time_table where date = 200102; run; proc sql; create table step_3 as select a.*, b.* from step_1 as a left join step_2 as b on a.date = b.time; quit; data step_5; set step_4_1; array Month (6) date_200101 date_200102 date_200103 date_200104 date_201510 date_201510 date_201510 do i = 1 to 7; if Month{i} in ('90','120','150','180') then do; bad = 1; mnth = i; i = 7; end; else bad = 0; end; if month{7} in ('90','120','150','180') then do; Bad_1 = 1; end; else bad_1 = 0 ; count_1 = 1; drop i; run;
... View more