RUN-UNIT in a IDMS COBOL program



Programming support for IDMS(Integrated Database Management System), IDD, IDMS-DC & ADS/Online

RUN-UNIT in a IDMS COBOL program

Postby kabya79 » Wed Aug 08, 2007 3:27 pm

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.
kabya79
 
Posts: 1
Joined: Wed Aug 01, 2007 1:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: RUN-UNIT in a IDMS COBOL program

Postby stalwart_itsme » Tue Mar 04, 2008 3:42 pm

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.
Stalwart.
...one dead, and the other powerless to be born...
stalwart_itsme
 
Posts: 3
Joined: Tue Mar 04, 2008 3:15 pm
Has thanked: 0 time
Been thanked: 0 time

Re: RUN-UNIT in a IDMS COBOL program

Postby stalwart_itsme » Tue Mar 04, 2008 3:56 pm

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. :ugeek:
Stalwart.
...one dead, and the other powerless to be born...
stalwart_itsme
 
Posts: 3
Joined: Tue Mar 04, 2008 3:15 pm
Has thanked: 0 time
Been thanked: 0 time

Re: RUN-UNIT in a IDMS COBOL program

Postby Dennis1SOIL » Tue Jun 30, 2009 10:02 pm

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).
Dennis1SOIL
 
Posts: 1
Joined: Tue Jun 30, 2009 9:11 pm
Has thanked: 0 time
Been thanked: 0 time

Re: RUN-UNIT in a IDMS COBOL program

Postby selvakumarmvs » Sun Jul 25, 2010 10:50 am

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????
selvakumarmvs
 
Posts: 9
Joined: Fri Feb 05, 2010 10:14 am
Has thanked: 0 time
Been thanked: 0 time


Return to IDMS/ADSO

 


  • Related topics
    Replies
    Views
    Last post