× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Charles is correct.

I think the first time I used RPG COMMIT and ROLBK op codes, in conjunction
with F-specs, was around 1993. That ability is likely a lot older than
that.

The first time I used that was in a new program posting a daily order
batch. I designed the program to post the entire batch, and at the end,
check to ensure the postings were in balance (debits = credits, plus a few
other ways of balancing).

If the batch was out of balance for any reason, the program would do a
ROLBK of the entire batch, and send a message to QSYSOPR. I would then fix
the root cause of the problem (code and/or data), and resubmit the batch
job. I rolled the entire batch back, because I didn't want to have to
figure out how to post a partial batch in the middle of the night. It
didn't happen often, but when it did, that design made it simple to
recover.

Give some thought as to what you want your "unit of work" to be, as there's
a lot of ways to structure it. The design of the tables and application,
and the volume of data involved, will heavily influence what unit of work
is possible or preferable. Quite a number of times, for developers using
commitment control for the first time, I've seen them code units of work,
that provide little to no assistance during recovery of a failed job or
transaction.

Mike



date: Wed, 18 Nov 2015 14:52:37 -0500
from: Charles Wilt <charles.wilt@xxxxxxxxx>
subject: Re: RPGLE I/O opcodes with commit/rollback

uh....using the COMMIT and ROLBK op-codes?

You have to use the COMMIT keyword on the f-spec for the file.

Or if you're talking RPGIII, the op-codes are COMIT and ROLBK and the
f-spec keyword is done as a continuation line with KCOMIT in position 53-59

Charles


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.