Joined: 30 Nov 2013 Posts: 795 Location: The Universe
If I understand what you are asking, you want to determine the time from when the job was submitted to the current time. This can be done, though it is not trivial. You need to traverse some control blocks to get the submission date & time. I have the notes, but I can't access them at the moment. Another problem is you have to compute current date & time minus submission date & time which can be moderately difficult if the dates are different. I think there is an example of this computation over in the beginner's forum from several years ago and I'm too lazy to find it now. It was intended for SMF data and potentially has problems if the difference is in months, but this is not an issue you are likely to face.
However, I'm not so certain that what I think you want is something that is useful, but ...
Not an easy answer to this one. If I understand it correctly, you want the job to go in to error status in TWS if it's been waiting for more than 15 minutes? What it's waiting for is not clear, but perhaps not relevant. Essentially you cannot do that as far as I'm aware, but there are perhaps other ways to accomplish something similar.
Assuming you can identify the start of the 15 minute interval then the easiest way would probably be to run a job on a "wait" work-station for 15 minutes, then run a TWS batch script to check the status of the job you're interested in. If it's still waiting, this new job could go in to error, or even just set the waiting one to error state.
Other options that spring to mind are to use the deadline WTO function to issue an alert to the console/your automation package if it has not started within the allowable time frame, or if you have the TWSemon product from APS you can set up an alert in there.