1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
* Raynald Levesque 2002/08/14.

data list list /appt arrival mdnp.
begin data
10.00 9.37 10.00
10.00 10.05 10.15
10.00 9.30 9.55
12.50 13.00 13.25
13.00 12.50 12.55
13.50 27 14.10
end data.
list.


do repeat var1=appt arrival mdnp /var2=tappt tarrival tmdnp.
compute var2=number(
	concat(string(trunc(var1),N2),
	":",
	string(mode(var1,1)*100,N2)),
	time5).
formats var2(time5).
end repeat print.

if arrival=27 tarrival=tappt.
compute waittime=max(0,ctime.minutes(tmdnp - max(tappt,tarrival))).
variable label waittime 'wait time in minutes'.
formats waittime(f8). 
exe.