Skip to main content

Can ACuCobol wrun32.exe find its own PID?

  • Jan 28, 2021 4:38 PM UTC
  • 7 replies
  • 17 views

I want to be able to have Program A kick Program B off as a thread, have program b stores its pid in a database record such that program a can be invoked at a later time to kill Program B

We are using version 9.2.1, 9.2.3 and 10.1

Acugt and acu4gl

Jim

7 replies

Jaap Voerman
Forum|alt.badge.img+1
  • Participating Frequently
  • Jan 28, 2021 4:56 PM UTC

I want to be able to have Program A kick Program B off as a thread, have program b stores its pid in a database record such that program a can be invoked at a later time to kill Program B

We are using version 9.2.1, 9.2.3 and 10.1

Acugt and acu4gl

Jim

Yes it can with C$PID and using de windows command TASKLIST and TASKKILL. The last 2 you use C$SYSTEM.

  • Jan 28, 2021 8:01 PM UTC
Yes it can with C$PID and using de windows command TASKLIST and TASKKILL. The last 2 you use C$SYSTEM.
thank you , I will look for sample code.
jim

  • Feb 26, 2021 8:37 AM UTC
thank you , I will look for sample code.
jim

Could you provide an example of acugt cobol requesting the pid under windows?

 

Server 2012 for example


Jaap Voerman
Forum|alt.badge.img+1
  • Participating Frequently
  • Feb 26, 2021 6:23 PM UTC

Could you provide an example of acugt cobol requesting the pid under windows?

 

Server 2012 for example

Yes, it can, use C$GETPID.

Stephen Hjerpe
  • Participating Frequently
  • Feb 26, 2021 9:35 PM UTC

Could you provide an example of acugt cobol requesting the pid under windows?

 

Server 2012 for example

identification division.
program-id. getpid.

data division.
working-storage section.
01 pid pic 9(5).

procedure division.
main-logic.
call "C$GETPID" giving pid
display "the PID of this process is: ", pid
accept omitted
stop run
.


  • Mar 12, 2021 8:11 AM UTC

identification division.
program-id. getpid.

data division.
working-storage section.
01 pid pic 9(5).

procedure division.
main-logic.
call "C$GETPID" giving pid
display "the PID of this process is: ", pid
accept omitted
stop run
.

Thank you

I shall try that.

 

Jim


  • Mar 19, 2021 2:32 AM UTC

Thank you

I shall try that.

 

Jim

It worked perfectly THANKS!