Uniquely identify batch job - PID?

At times it is necessary to kill a Natural batch job, but all you see in Windows Task Manager is a set of entries named nderun.exe, with no indication of which is which.

Is it possible to determine the Process ID (PID) from within a Natural batch session? If so, I could match it against the PID displayed in Task Manager. I’ve looked at system variables and the API.

Natural’s *PID should be identical with the PID shown in the Task Manager. So the only thing you have to do is to log the batch-job-PIDs somewhere. But I don’t know how to find out the PID without logging *PID…

As I stated in my initial posting, I had reviewed the System Variables. I had the impression that the Process ID was available from within Natural, but I couldn’t find it. Quite stupid of me not to have seen *PID. Thanks, Matthias.

I created a program to write the PID to a WORK file, along with several other System Variables, to allow me to identify a specific batch job. We use a standard NATPARM for all batch jobs, so I placed the program name in its STACK parameter. Within my program, I define the WORK file with the APPEND attribute, giving me a log of all batch jobs and their associated PIDs.

Hi Ralph,

“procexp.exe” from Sysinternals provides much more details than Windows Task Manager such as the command line that started the process.

This may help you easier to identify a task.