Skip to main content

Can ACuCobol wrun32.exe find its own PID?

  • January 28, 2021
  • 7 replies
  • 0 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
  • January 28, 2021

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.

  • January 28, 2021
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

  • February 26, 2021
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
  • February 26, 2021

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
  • February 26, 2021

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
.


  • March 12, 2021

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


  • March 19, 2021

Thank you

I shall try that.

 

Jim

It worked perfectly THANKS!