In reply to Shen.

Shen,

I just published a sample that shows how to cancel a SAS job that your task submits: the Calculate Cardinalities task. But that's a little different than what you're looking for.

Most of my ISASTaskExecution samples don't implement Cancel (returning false). If your process is "interruptable", you can implement what you need to "stop" whatever process you're running. Some caveats: the call to Cancel might come in on a different Windows thread than the one that's actually running the process, so make sure that your "stop processing" code is thread-safe.