rogue message queues solaris 9

We have message queues created from our ERP system to our tax system via an application api written by the ERP software vendor.
Occasionally when a user does not gracefully exit the ERP application, the message queue hangs. After a few months, this becomes a problem as the queues are all used up.
I can write a script to remove any message queues that are not associated to a currently active user. However, when I do ipcs -q it only shows me the userid. Is there a way to associate a message queue with a PID ? I am not seeing a switch in the man pages for ipcs to do this. I am posting this in hopes maybe there is another command (or system link) I am not aware of.

thanks!

ipcs -qp

:eek: DOH ! - two of us missed that in the man pages. Time for vacation.

THANKS! :smiley: