Antwort: [DB2-L] Separate UOW from COBOL batch program zOS - Is it possible

Rolf Drees

Antwort: [DB2-L] Separate UOW from COBOL batch program zOS - Is it possible
Hello Jantje,

it is possible to do this. Your progam has to create 2 seperate
connections to DB2, this can be done via RRSAF-calls. Please look at
Application Programming SQL Guide, Chapter 32, Programming the RRSAF.
You have to call DSNRLI with function Create Thread. You can switch
between the 2 Threads with the switch-function. Each thread can be
commited seperatly.

Kind regards
Rolf Drees
Anwendungsentwicklung Querschnittsfunktionen / Datenbankmanagement
Tel.: 0251 7133 - 2238 ; Fax.: 0251 7133 - 92238

GAD eG
GAD-Straße 2 - 6
48163 Münster

http://www.gad.de

Vorstand: Anno Lederer (Vors.), Dr. Elmar Pritsch (stv. Vors.), Jörg
Dreinhöfer, Friedhelm Wagner
Aufsichtsratsvorsitzender: Wilfried Guttmann
Sitz: Münster/Westf., Amtsgericht Münster, Genossenschafts-Register 337



Jan tje <[login to unmask email]>
Gesendet von: DB2 Data Base Discussion List <[login to unmask email]>
23.01.2009 13:49
Bitte antworten an
DB2 Database Discussion list at IDUG <[login to unmask email]>


An
[login to unmask email]
Kopie

Thema
[DB2-L] Separate UOW from COBOL batch program zOS - Is it possible






Dear Listers,

zOS 1.8 - DB2 8

I have the need to commit an insert to a given table without committing
the
work done on other tables. The program is written in COBOL and runs in
batch.

Now, I know that it is not possible to commit only part of a unit-of-work
(UOW). It would not be a unit, would it?

So, a wild idea spurred: let's leave the current UOW, create a new,
separate
UOW, insert the data in the one table and commit only this separate UOW.
Then return to the original UOW to continue the work there.

Only, I have no clue on how I can do just that... Do you?

Thanks for any and all suggestions.

Cheers,

Jantje.

______________________________________________________________________

* IDUG 2009 Melbourne, Australia * 18-20 March * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You
should have gotten an e-mail with the temporary password assigned to your
account. Please log in and update your member profile. If you are not
already an IDUG.org member, please register at
http://www.idug.org/component/juser/register.html


______________________________________________________________________

* IDUG 2009 Melbourne, Australia * 18-20 March * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html

PUSCH Othmar

AW: [DB2-L] Separate UOW from COBOL batch program zOS - Is it possible
(in response to Rolf Drees)
Hi dear Jantje !

Just an idea ... maybe another street possible --->

Using savepoints to undo selected changes within a unit of work Savepoints let you undo selected changes within a transaction. Your application can set any number of savepoints using SQL SAVEPOINT statements, and then use SQL ROLLBACK TO SAVEPOINT statements to indicate which changes within the unit of work to undo. When the application no longer uses a savepoint, it can delete that savepoint using the SQL RELEASE SAVEPOINT statement. You can write a ROLLBACK TO SAVEPOINT statement with or without a savepoint name. If you do not specify a savepoint name, DB2 rolls back work to the most recently created savepoint.

Kinds/othmar

Kollegiale & freundliche Grüße / Othmar E.R. PUSCH sen.
(Tel.: ++43/(0)1-21717_(79-)59739)
Senior-Systemsprogrammer & Betriebsrat der Unicredit Bank Austria AG



-----Ursprüngliche Nachricht-----
Von: DB2 Data Base Discussion List [mailto:[login to unmask email] Im Auftrag von Jan tje
Gesendet: Freitag, 23. Jänner 2009 13:50
An: [login to unmask email]
Betreff: [DB2-L] Separate UOW from COBOL batch program zOS - Is it possible

Dear Listers,

zOS 1.8 - DB2 8

I have the need to commit an insert to a given table without committing the work done on other tables. The program is written in COBOL and runs in batch.

Now, I know that it is not possible to commit only part of a unit-of-work (UOW). It would not be a unit, would it?

So, a wild idea spurred: let's leave the current UOW, create a new, separate UOW, insert the data in the one table and commit only this separate UOW.
Then return to the original UOW to continue the work there.

Only, I have no clue on how I can do just that... Do you?

Thanks for any and all suggestions.

Cheers,

Jantje.

______________________________________________________________________

* IDUG 2009 Melbourne, Australia * 18-20 March * http://IDUG.ORG/Events * ______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html

______________________________________________________________________

* IDUG 2009 Melbourne, Australia * 18-20 March * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html

Agus Kwee

Re: Separate UOW from COBOL batch program zOS - Is it possible
(in response to PUSCH Othmar)
Jantje,

I think a batch DB2 thread can only have 1 UOW at a time.
You can do the insert as the first sql statement in your program, issue the commit, and then
do the rest of your sql statements.

Regards,
Agus Kwee
Themis Training
http://www.themisinc.com

----- Original Message -----
From: Jan tje
Date: Friday, January 23, 2009 9:09 am
Subject: [DB2-L] Separate UOW from COBOL batch program zOS - Is it possible
To: [login to unmask email]

> Dear Listers,
>
> zOS 1.8 - DB2 8
>
> I have the need to commit an insert to a given table without
> committing the
> work done on other tables. The program is written in COBOL and
> runs in batch.
>
> Now, I know that it is not possible to commit only part of a
> unit-of-work
> (UOW). It would not be a unit, would it?
>
> So, a wild idea spurred: let's leave the current UOW, create a
> new, separate
> UOW, insert the data in the one table and commit only this
> separate UOW.
> Then return to the original UOW to continue the work there.
>
> Only, I have no clue on how I can do just that... Do you?
>
> Thanks for any and all suggestions.
>
> Cheers,
>
> Jantje.
>
> ______________________________________________________________________
>
> * IDUG 2009 Melbourne, Australia * 18-20 March *
> http://IDUG.ORG/Events *
> ______________________________________________________________________
>
>
>
>
> IDUG.org was recently updated requiring members to use a new
> password. You should have gotten an e-mail with the temporary
> password assigned to your account. Please log in and update your
> member profile. If you are not already an IDUG.org member,
> please register at http://www.idug.org/component/juser/register.html
>

______________________________________________________________________

* IDUG 2009 Melbourne, Australia * 18-20 March * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html

Brian Goldberg

Re: Antwort: [DB2-L] Separate UOW from COBOL batch program zOS - Is it possible
(in response to Agus Kwee)
Another way is to write a small program to do the insert, then write JCL to a reader to execute the program.

Thanks.

Brian Goldberg
QVC, Inc., Systems Engineer
Studio Park
West Chester, PA 19380-4262
(484) 701-1210
Studio Park: Tuesday-Friday


This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient of this e-mail (even if the e-mail address above is yours), (i) you may not use, copy or retransmit it, (ii) please delete this message and (iii) please notify the sender immediately. Any disclosure, copying, or distribution of this message or the taking of any action based on it, is strictly prohibited.
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On Behalf Of [login to unmask email]
Sent: Friday, January 23, 2009 8:49 AM
To: [login to unmask email]
Subject: [DB2-L] Antwort: [DB2-L] Separate UOW from COBOL batch program zOS - Is it possible


Hello Jantje,

it is possible to do this. Your progam has to create 2 seperate connections to DB2, this can be done via RRSAF-calls. Please look at Application Programming SQL Guide, Chapter 32, Programming the RRSAF.
You have to call DSNRLI with function Create Thread. You can switch between the 2 Threads with the switch-function. Each thread can be commited seperatly.

Kind regards
Rolf Drees
Anwendungsentwicklung Querschnittsfunktionen / Datenbankmanagement
Tel.: 0251 7133 - 2238 ; Fax.: 0251 7133 - 92238

GAD eG
GAD-Straße 2 - 6
48163 Münster

http://www.gad.de

Vorstand: Anno Lederer (Vors.), Dr. Elmar Pritsch (stv. Vors.), Jörg Dreinhöfer, Friedhelm Wagner
Aufsichtsratsvorsitzender: Wilfried Guttmann
Sitz: Münster/Westf., Amtsgericht Münster, Genossenschafts-Register 337

Jan tje <[login to unmask email]>
Gesendet von: DB2 Data Base Discussion List <[login to unmask email]>

23.01.2009 13:49
Bitte antworten an
DB2 Database Discussion list at IDUG <[login to unmask email]>


An

[login to unmask email]

Kopie

Thema

[DB2-L] Separate UOW from COBOL batch program zOS - Is it possible







Dear Listers,

zOS 1.8 - DB2 8

I have the need to commit an insert to a given table without committing the
work done on other tables. The program is written in COBOL and runs in batch.

Now, I know that it is not possible to commit only part of a unit-of-work
(UOW). It would not be a unit, would it?

So, a wild idea spurred: let's leave the current UOW, create a new, separate
UOW, insert the data in the one table and commit only this separate UOW.
Then return to the original UOW to continue the work there.

Only, I have no clue on how I can do just that... Do you?

Thanks for any and all suggestions.

Cheers,

Jantje.

______________________________________________________________________

* IDUG 2009 Melbourne, Australia * 18-20 March * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html

________________________________

IDUG 2009 - North America * May 11-15 * Denver, Colorado, USA < http://idug.org/lsna >

IDUG.org <http://www.idug.org> was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register here.< http://www.idug.org/component/juser/register.html >

______________________________________________________________________

* IDUG 2009 Melbourne, Australia * 18-20 March * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html

Phil Grainger

Re: Separate UOW from COBOL batch program zOS - Is it possible
(in response to Brian Goldberg)
The SIMPLEST (but not the only) way to do this would be to INSERT your row BEFORE DOING ANY OTHER CHANGES to the database, then COMMITting it

Of course, that means possibly considerable rework of your applictaion

Phil Grainger
CA
Senior Principal Product Manager
Phone: +44 (0)1753 577 733
Mobile: +44 (0)7970 125 752
eMail: [login to unmask email]
Ditton Park
Riding Court Road
Datchet
Slough
SL3 9LL
CA plc a company registered in England and Wales under company registration number 1282495 with its registered office at the address set out above. VAT number 697904179.

-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On Behalf Of Jan tje
Sent: 23 January 2009 12:50
To: [login to unmask email]
Subject: [DB2-L] Separate UOW from COBOL batch program zOS - Is it possible

Dear Listers,

zOS 1.8 - DB2 8

I have the need to commit an insert to a given table without committing the
work done on other tables. The program is written in COBOL and runs in batch.

Now, I know that it is not possible to commit only part of a unit-of-work
(UOW). It would not be a unit, would it?

So, a wild idea spurred: let's leave the current UOW, create a new, separate
UOW, insert the data in the one table and commit only this separate UOW.
Then return to the original UOW to continue the work there.

Only, I have no clue on how I can do just that... Do you?

Thanks for any and all suggestions.

Cheers,

Jantje.

______________________________________________________________________

* IDUG 2009 Melbourne, Australia * 18-20 March * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html

Dave Nance

Re: Separate UOW from COBOL batch program zOS - Is it possible
(in response to Phil Grainger)
Not sure why you would be doing this, but if other options do not work for you, then from your batch process kick off another process, send it to MQ, start another batch job, call a cics transaction, etc... and let that process do the work that you want separated from your current UOW.
 
David Nance





________________________________
From: "Grainger, Phil" <[login to unmask email]>
To: [login to unmask email]
Sent: Sunday, January 25, 2009 2:53:30 AM
Subject: Re: [DB2-L] Separate UOW from COBOL batch program zOS - Is it possible

The SIMPLEST (but not the only) way to do this would be to INSERT your row BEFORE DOING ANY OTHER CHANGES to the database, then COMMITting it

Of course, that means possibly considerable rework of your applictaion

Phil Grainger
CA
Senior Principal Product Manager
Phone: +44 (0)1753 577 733
Mobile: +44 (0)7970 125 752
eMail: [login to unmask email]
 
Ditton Park
Riding Court Road
Datchet
Slough
SL3 9LL
 
CA plc a company registered in England and Wales under company registration number 1282495 with its registered office at the address set out above. VAT number 697904179.

-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On Behalf Of Jan tje
Sent: 23 January 2009 12:50
To: [login to unmask email]
Subject: [DB2-L] Separate UOW from COBOL batch program zOS - Is it possible

Dear Listers,

zOS 1.8 - DB2 8

I have the need to commit an insert to a given table without committing the
work done on other tables. The program is written in COBOL and runs in batch.

Now, I know that it is not possible to commit only part of a unit-of-work
(UOW). It would not be a unit, would it?

So, a wild idea spurred: let's leave the current UOW, create a new, separate
UOW, insert the data in the one table and commit only this separate UOW.
Then return to the original UOW to continue the work there.

Only, I have no clue on how I can do just that... Do you?

Thanks for any and all suggestions.

Cheers,

Jantje.

______________________________________________________________________

* IDUG 2009 Melbourne, Australia * 18-20 March * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html





______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html

Jan tje

Re: Separate UOW from COBOL batch program zOS - Is it possible
(in response to Dave Nance)
On Fri, 23 Jan 2009 12:49:48 +0000, Jan tje <[login to unmask email]>
wrote:

>Dear Listers,
>
>So, a wild idea spurred: let's leave the current UOW, create a new, separate
>UOW, insert the data in the one table and commit only this separate UOW.
>Then return to the original UOW to continue the work there.

Dear responders,

Re-structuring the program so that the insert could be done either as the very
first or as the very last operation had already been considered before I asked
the question, but would indeed require major (and I mean Major...) re-work
(and testing & QA time). Therefore that option as been set aside.

Several responders suggested submitting the insert to a separate process,
either through the internal reader, through MQ, or such. That option would
mean to incur quite some overhead and I was trying to avoid that.

The assembler main program managing several TCB and related separate
connections to DB2 seems also to costly to develop.

I am reading the FM on the RRSAF stuff now and will probably be going with
that.

Thanks again to all how have responded,

Jantje.

______________________________________________________________________

* IDUG 2009 Melbourne, Australia * 18-20 March * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html

Jan tje

Re: Antwort: [DB2-L] Separate UOW from COBOL batch program zOS - Is it possible
(in response to Jan tje)
On Fri, 23 Jan 2009 14:48:44 +0100, [login to unmask email] wrote:

>Hello Jantje,
>
>it is possible to do this. Your progam has to create 2 seperate
>connections to DB2, this can be done via RRSAF-calls. Please look at
>Application Programming SQL Guide, Chapter 32, Programming the RRSAF.
>You have to call DSNRLI with function Create Thread. You can switch
>between the 2 Threads with the switch-function. Each thread can be

But that SWITCH TO function is to switch to another DB2 sub-system... How
do I switch between two threads to the SAME sub-system?

Thanks,

Jantje.

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html