[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Commit in DB2/MVS



Randy,

If you have any cursors open (BEGIN-SELECT, BEGIN-SQL), and you COMMIT, DB@
will close ALL open cursors.  So if your in the middle of a select loop like
so:

BEGIN-SELECT
row1
row2

    ADD 1 TO #RowCount

    <Process Data>

    IF ( #RowCount > 100 )

        COMMIT
        MOVE 0 TO #RowCount

    END-IF

FROM table
WHERE row3 =x
END-SELECT

Soon as you commit, the database no longer has a cursor pointing to where
you are, so when you go to process another row, the database won't know what
you want and blow your SQR.

If you need to COMMIT in the middle of a select loop, you have to save the
keys as to where you are (and select date in the order of the keys), get out
of the select loop, commit, and then restart your select loop with the row
greater than your saved keys (a real pain).

......Rob
_________________________________________________
Robert Goshko <mailto:robert.goshko@axis-dev.com>
Owner
Axis Developments
System Consulting Services
Sherwood Park, Alberta, Canada
http://www.axis-dev.com/


-----Original Message-----
From: Discussion of SQR, SQRIBE Technologies's database reporting
language [mailto:SQR-USERS@list.iex.net]On Behalf Of Randy Learn
Sent: Thursday, October 01, 1998 1:48 PM
To: Multiple recipients of list SQR-USERS
Subject: Commit in DB2/MVS


Any help would be greatly appreciated.

I am using DB2 version 4 and SQR version 4 on windows NT and MVS
mainframe.
I have an sqr program that issues a commit after x number of records are
processed.
When I run it on the NT/Client it runs ok, when I run it on the MVS
server it abends after the commit is executed.  The commit is actually
working, but it seems to blow up on a select after the commit.   The
program runs ok on MVS with the 'commit' commented out.  This is a
conversion program that will load a large volume of data and needs to do
a commit periodically.

Has anyone else run into this???


DSN      ENDED DUE TO ERROR+
 SYSTEM ABEND CODE 04E   REASON CODE 00E7000C  PSW 077C100087713180
ASIDS:  HOME
1LSCX041 **** ERROR ****
         ABEND occurred in line  1020 of    SQ043(SQ048)  ,offset 000390

         Program terminated by operating system. ABEND code = S04E
         A non-C or system routine was running at the time of ABEND