How to see if the process is idle

We are running AIX 5.3 and for ICICS Printing we have process called cicstermp runing whcih attaches the print to print queue

But is process is triggered when ever a print is to be given

Can we find the processes which are idle

I mean every time a print is given it creats a new cicstermp process but it doesnot kill it when its done

Can we find these kind of processes
Some times even if the shell which triggered it gets closed the process runs with out a terminal

I am posting few of those output form ps -ef

root 5931186 1 0 10:00:12 pts/29 0:00 cicstermp -r CICSREGION -n PRINTER -P lp -cs -dcaisse

root 6017234 1 0 Aug 28 - 0:00 cicstermp -r CICSREGION -n PRINTER -P lp -cs -dcaisse

Hi,
i hope this will help you

# Checking and counting the process [ABC.EXE] which is running on root directory "/"
COUNT=`cd / |ps -ef |grep ABC.EXE |wc -l`

# THIS WILL CHECK EITHER SERVICE IS RUNNING OR NOT
if [ $COUNT = 0 ]
then
ABC.EXE
echo "SERVICE STARTED"
exit 0
fi

# THIS WILL CHECK IF THE SERVICE IS RUNNING ONLY ONCE
if [ $COUNT = 1 ]
then
echo "SERVICES ALREADYRUNNING"
exit 0
fi

# THIS WILL CHECK IF THE SERVICE IS RUNNING MORE THAN ONCE
if [ $COUNT > 1 ]
then
banner ERROR
echo "SERVICES HALTED - MORE THAN ONE INSTANCE"
echo "PLEASE RESTART"
echo "PRESS ANY KEY TO CONTINUE"
read exit
exit 0
fi