rulan: Every example I've read (except MoonBuddy's first example, which was plainly a demo of how to get and cancel a single process, suitable for modification into your own scripting environment) cancels all processes.
Chad managed to get dos to do it in the post directly above yours. Further up, I do it with unix shell syntax using a for loop. Directly above that PJ does the same with a while loop(though not in a way I'd trust), and even mine left off discarding the stupid commas.
If you expect it to happen in pure tsm scripting, your expectation is going to go unmet.... at least in classic TSM. the db2 stuff in 6.1 probably lets you do some pretty flexible things.
You'll need to learn the rudiments of a scripting environment to understand the examples above, and to implement them for your own. I believe somebody's written perl modules for TSM. I personally was in too big a hurry and just scripted directly against the dsmadmc, using bourne syntax. MoonBuddy's wintel example above is impressive. When I've got to work from windows, I set up cygwin and use a real operating environment.