Hi,
I am having a IDMS cobol program where the control is being transfered to a second COBOl program and then it returns back to the first COBOL program.
How may RUN-UNIT would be present when the second COBOL program is execution ?. Are there going to be 2 RUN-UNITs? Or will there be only one RUN-UNIT? If someone can clarify my doubt on the RUN-UNIT concept it would be a great help.
Thanks in advance.
RUN-UNIT in a IDMS COBOL program
-
- Posts: 3
- Joined: Tue Mar 04, 2008 3:15 pm
- Skillset: COBOL,JCL,IDMS,CICS
- Referer: internet
Re: RUN-UNIT in a IDMS COBOL program
Hi,
A "Run Unit" refers to an IDMS program that was or is running between the time of the "BIND
RUN-UNIT" statement until the final FINISH or ROLLBACK.
Here in your case it could be minimum two run unit in the following case. First IDMS-cobol program is one run-unit, which processess the database, issues finish and goes to the sub program. In the subprogram it again issues Bind run-unit, processess the database, finishes it and comes back again to main program. So it is two run-unit. It could even be three run-unit if it is again issues bind run-unit after returning from the subprogram...
If the sub-program is not accessing the IDMS database, then it could be one run-unit, which is issued in the main IDMS Cobol program.
A "Run Unit" refers to an IDMS program that was or is running between the time of the "BIND
RUN-UNIT" statement until the final FINISH or ROLLBACK.
Here in your case it could be minimum two run unit in the following case. First IDMS-cobol program is one run-unit, which processess the database, issues finish and goes to the sub program. In the subprogram it again issues Bind run-unit, processess the database, finishes it and comes back again to main program. So it is two run-unit. It could even be three run-unit if it is again issues bind run-unit after returning from the subprogram...

If the sub-program is not accessing the IDMS database, then it could be one run-unit, which is issued in the main IDMS Cobol program.
Stalwart.
...one dead, and the other powerless to be born...
...one dead, and the other powerless to be born...
-
- Posts: 3
- Joined: Tue Mar 04, 2008 3:15 pm
- Skillset: COBOL,JCL,IDMS,CICS
- Referer: internet
Re: RUN-UNIT in a IDMS COBOL program
More over a program can have any number of run-units.
In Your program, number of run-units depends upon, Number of times u give Bind Run-unit and Finish command.
In Your program, number of run-units depends upon, Number of times u give Bind Run-unit and Finish command.

Stalwart.
...one dead, and the other powerless to be born...
...one dead, and the other powerless to be born...
-
- Posts: 1
- Joined: Tue Jun 30, 2009 9:11 pm
- Skillset: IDMS DBA and Applications Programmer and some Systems work. (over 20 years)
- Referer: web search
Re: RUN-UNIT in a IDMS COBOL program
If your desire is to have both the calling (driver) program and the subordinate (called) program using the same single run-unit ... I will tell you how below.
First though, remember a recovery unit consists of all the updates between Checkpoints (where a the BIND RUN-UNIT DML verb is the first Checkpoint and either a COMMIT or a FINISH is the next Checkpoint). If your program(s) happen to abort at any time - all the updates done in that one Run-unit/Recovery-Unit (i.e. since the run-unit was started or since the most recent COMMIT was issued) will be rolled out. So, given this information - you may NEED to have only a single run-unit being used for updates done by both the driver and the sub-program.
OK, here is the way to share the run-unit :
The key things to remember are:
1) The SUBSCHEMA-CTRL block must be passed from the Driver program to the Sub-program (so the sub-program will issue the 'COPY IDMS SUBSCHEMA-CONTROL' statement in it's LINKAGE AREA and the Driver program passes SUBSCHEMA-CTRL via a USING when it calls the sub-program).
2) The Driver program is the only program to issue the "BIND RUN-UNIT" DML verb.
(Note also: If both programs will access the same record-type, the Bind address for any shared records must also be passed between programs).
First though, remember a recovery unit consists of all the updates between Checkpoints (where a the BIND RUN-UNIT DML verb is the first Checkpoint and either a COMMIT or a FINISH is the next Checkpoint). If your program(s) happen to abort at any time - all the updates done in that one Run-unit/Recovery-Unit (i.e. since the run-unit was started or since the most recent COMMIT was issued) will be rolled out. So, given this information - you may NEED to have only a single run-unit being used for updates done by both the driver and the sub-program.
OK, here is the way to share the run-unit :
The key things to remember are:
1) The SUBSCHEMA-CTRL block must be passed from the Driver program to the Sub-program (so the sub-program will issue the 'COPY IDMS SUBSCHEMA-CONTROL' statement in it's LINKAGE AREA and the Driver program passes SUBSCHEMA-CTRL via a USING when it calls the sub-program).
2) The Driver program is the only program to issue the "BIND RUN-UNIT" DML verb.
(Note also: If both programs will access the same record-type, the Bind address for any shared records must also be passed between programs).
-
- Posts: 9
- Joined: Fri Feb 05, 2010 10:14 am
- Skillset: cobol,jcl,vsam,db2,idms
- Referer: google
Re: RUN-UNIT in a IDMS COBOL program
Hi Dennis,
You said that If both programs will access the same record-type, the Bind address for any shared records must also be passed between programs...
what is the Bind address for shared record??? can u give some example plz...
Instead of passing bind address, can we pass DB key of shared record and obtain that shared record data in sub-program without binding that shared record in sub-program...is it possible????
You said that If both programs will access the same record-type, the Bind address for any shared records must also be passed between programs...
what is the Bind address for shared record??? can u give some example plz...
Instead of passing bind address, can we pass DB key of shared record and obtain that shared record data in sub-program without binding that shared record in sub-program...is it possible????
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Calling Java program on UNIX/USS from a COBOL CICS program?
by zbius » Tue Nov 05, 2024 2:37 pm » in IBM Cobol - 2
- 2589
-
by zbius
View the latest post
Wed Nov 06, 2024 6:02 pm
-
-
- 2
- 3157
-
by enrico-sorichetti
View the latest post
Mon Oct 30, 2023 6:25 pm
-
- 1
- 2424
-
by engh
View the latest post
Fri Jul 08, 2022 7:31 pm
-
- 6
- 1925
-
by sergeyken
View the latest post
Sat Jul 17, 2021 12:38 am
-
-
Find the version of a cobol program through its load module
by vinigim » Fri Oct 30, 2020 3:16 am » in IBM Cobol - 5
- 5138
-
by chaat
View the latest post
Sat Nov 07, 2020 8:40 am
-