rexx implicitely commits when error

nguyen duc tuan

rexx implicitely commits when error
Hi all ,

I am developing an utility with rexx, how to change my rexx to not commit
the changes when it encountered a syntax error ?
Is there any way to trap the error condition and execute a special function
before leaving

thank you

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". If you will be out of the office, send the SET DB2-L NO MAIL command to [login to unmask email] The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Binyamin Dissen

Re: rexx implicitely commits when error
(in response to nguyen duc tuan)
On Fri, 12 Dec 2003 05:03:19 -0600 nguyen dt <[login to unmask email]>
wrote:

:>I am developing an utility with rexx, how to change my rexx to not commit
:>the changes when it encountered a syntax error ?
:>Is there any way to trap the error condition and execute a special function
:>before leaving

SIGNAL ON SYNTAX .....
SIGNAL ON FAILURE .....
.
.

--
Binyamin Dissen <[login to unmask email]>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". If you will be out of the office, send the SET DB2-L NO MAIL command to [login to unmask email] The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Marcus Davage

Re: rexx implicitely commits when error
(in response to Binyamin Dissen)
In your rexx, put a SIGNAL ON SYNTAX statement (or a CALL ON SYNTAX
statement), also supplying a procedure...

SYNTAX:
ADDRESS DSNREXX "EXECSQL ROLLBACK"
.
.
.
RETURN

Marcus Davage CEng MBCS
IBM Certified Solutions Expert
DB2 UDB V7.1 Database Administration for UNIX, Linux, Windows and OS/2
DB2 UDB V7.1 Database Administration for OS/390
'The views expressed are my own and do not necessarily represent the views
or policy of my employer, Lloyds TSB Bank plc.'


-----Original Message-----
From: nguyen dt [mailto:[login to unmask email]
Sent: 12 December 2003 11:03
To: [login to unmask email]
Subject: rexx implicitely commits when error


Hi all ,

I am developing an utility with rexx, how to change my rexx to not commit
the changes when it encountered a syntax error ?
Is there any way to trap the error condition and execute a special function
before leaving

thank you

----------------------------------------------------------------------------
-----
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home
page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select
"Join or Leave the list". If you will be out of the office, send the SET
DB2-L NO MAIL command to [login to unmask email] The IDUG List Admins
can be reached at [login to unmask email] Find out the latest on
IDUG conferences at http://conferences.idug.org/index.cfm


---------------------------------------------------------------------------------------------------------------
This e-mail is intended only for the above addressee. It may contain
privileged information. If you are not the addressee you must not copy,
distribute, disclose or use any of the information in it. If you have
received it in error please delete it and immediately notify the sender.

evolvebank.com is a division of Lloyds TSB Bank plc.
Lloyds TSB Bank plc, 25 Gresham Street, London, EC2V 7HN. Registered in
England, number 2065. Telephone No: 020 7626 1500
Lloyds TSB Scotland plc, Henry Duncan House, 120 George Street,
Edinburgh EH2 4LH. Registered in Scotland, number 95237. Telephone
No: 0131 225 4555

Lloyds TSB Bank plc and Lloyds TSB Scotland plc are authorised and
regulated by the Financial Services Authority and represent only the
Scottish Widows and Lloyds TSB Marketing Group for life assurance,
pensions and investment business.

Signatories to the Banking Codes.
---------------------------------------------------------------------------------------------------------------


---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". If you will be out of the office, send the SET DB2-L NO MAIL command to [login to unmask email] The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Jim Ruddy

Re: rexx implicitely commits when error
(in response to Marcus Davage)
If you are talking about the IBM DSNREXX interface it does not do a commit
on a syntax error.

Jim Ruddy
DB2 for z/OS Development

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". If you will be out of the office, send the SET DB2-L NO MAIL command to [login to unmask email] The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Binyamin Dissen

Re: rexx implicitely commits when error
(in response to Jim Ruddy)
On Fri, 12 Dec 2003 11:39:00 -0600 [login to unmask email] wrote:

:>If you are talking about the IBM DSNREXX interface it does not do a commit
:>on a syntax error.

If it terminates normally without indicating an abend to MVS and without
issuing a ROLLBACK then MVS task-end will implicitly do the COMMIT.

--
Binyamin Dissen <[login to unmask email]>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". If you will be out of the office, send the SET DB2-L NO MAIL command to [login to unmask email] The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Michael Ebert

Re: rexx implicitely commits when error
(in response to Binyamin Dissen)
.... and, as we learned in the recent thread "How to end a REXX step with
an Abend", you can't abend a REXX step, even by calling e.g. the ILBOABN0
abend routine (there's also an assembler ABEND Macro; I haven't tried
calling that - it seems it is the only chance). So it seems you have to
catch all errors within REXX and issue a ROLLBACK explicitly.

Dr. Michael Ebert
DB2 Database Administrator
aMaDEUS Data Processing
Erding / Munich, Germany



On Fri, 12 Dec 2003 11:39:00 -0600 [login to unmask email] wrote:

:>If you are talking about the IBM DSNREXX interface it does not do a
commit
:>on a syntax error.

If it terminates normally without indicating an abend to MVS and without
issuing a ROLLBACK then MVS task-end will implicitly do the COMMIT.

--
Binyamin Dissen <[login to unmask email]>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel


---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". If you will be out of the office, send the SET DB2-L NO MAIL command to [login to unmask email] The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Jim Ruddy

Re: rexx implicitely commits when error
(in response to Michael Ebert)
True but this is not unique to DSNREXX - this is the way all attach
facilities work in DB2.

Jim Ruddy
DB2 for z/OS Development

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". If you will be out of the office, send the SET DB2-L NO MAIL command to [login to unmask email] The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm