You have two good answers from both Tom and Tim. I think you need to rethink your architecture.
But that doesn't answer the question about getting the PID. Assuming that you run some kind of connection to an Progress AppServer, that AppServer is running a .p-program and in that program you could do:
FIND FIRST _MyConnection NO-LOCK.
/* You might not want to DISPLAY but rather do something else: */
DISPLAY _MyConnection._MyConn-Pid.
You could also do this in the OS. Assuming you have run the proenv-script so you have your environment set up you can do:
wtbman -name asXXX -query
(Replace asXXX with the name of your appserver - default is asbroker1).
Output is something like this:
OpenEdge Release 11.3.1 as of Fri Sep 13 19:00:23 EDT 2013
Connecting to Progress AdminServer using rmi://localhost:xxxx/Chimera (8280)
Searching for asXXX (8288)
Connecting to asXXX (8276)
Incorrect utility to use for asXXX (15827)
Broker Name : asXXX
Operating Mode : State-reset
Broker Status : ACTIVE
Broker Port : YYYY
Broker PID : ZZZZ
Active Servers : 2
Busy Servers : 0
Locked Servers : 0
Available Servers : 2
Active Clients (now, peak) : (0, 2)
Client Queue Depth (cur, max) : (0, 2)
Total Requests : 26322
Rq Wait (max, avg) : (18079 ms, 25 ms)
Rq Duration (max, avg) : (18079 ms, 25 ms)
PID State Port nRq nRcvd nSent Started Last Change
16319 AVAILABLE ZZZZZ 001447 001447 001447 Aug 8, 2014 11:50 Aug 14, 2014 13:20
16320 BUSY ZZZZZ 001385 001385 001385 Aug 8, 2014 11:50 Aug 14, 2014 13:10
Look at the list of pids. 16319 is AVAILABLE and 16320 is busy and has been for 10 minutes (if the time is 13:20 right now). That tells us that PID 16320 most likely is the hanging procedure.
Now you can do:
asbman -name asxxx -agentdetail 16320
That will give you more information like PROPATH, Stack trace and connected databases. Very helpful when looking for problems.