Show us your code and test data so that we can see the exact problem.
This works :
data have;
informat switch_time1 switch_time2 hhmmss8.;
input switch_time1 switch_time2;
cards;
8:00:15 8:32:15 8:32:15
9:12:13 9:18:13 9:18:13
18:20:36 18:46:36 18:46:36
;
run;
proc sql;
CREATE TABLE MC_ET AS
SELECT case when intck("minute", switch_time1,switch_time2)>5 and intck("minute",switch_time1,switch_time2)<10 then 1 else 0 end AS betw5_10,
case when intck("minute", switch_time1,switch_time2)>10 and intck("minute",switch_time1,switch_time2)<15 then 1 else 0 end AS betw10_15,
sum(CALCULATED betw5_10) as Count_of_8,
sum(CALCULATED betw10_15) as Count_of_9
FROM have
;
quit;
... View more