You can do a self-join and then calculate the difference:
Code:
SELECT t1.progid, t1.date, t2.systemtime - t1.systemtime
FROM ... AS t1 JOIN ... AS t2 ON ( t1.progid = t2.progid AND t1.date = t2.date )
WHERE t1.status = 'S' AND
t2.status = 'E'
The basic idea is to get the start and end timestamps into a single row so that you can process that row in the SELECT list and/or WHERE clause.