× 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.



That's the easiest but maybe not the best. If you need to run under commitment control (which gives you the ability to roll back changes which is what you're seeing), leave the default commit settings and simply include a COMMIT statement when the program completes. If you want to undo your changes (for example, when you get an error), you use a ROLLBACK statement.

One other thing to point out with embedded SQL: If you are not using "SELECT *" in the program and changes were made to the file that you don't care about AND don't use in that program, you do not have to recompile the program. SQL doesn't have any concept of file levels.

Matt

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Lim Hock-Chai
Sent: Friday, June 13, 2008 12:10 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: Embedded SQL in RPG and Journaling Question

You must have forgotten to compile with COMMIT(*CHG). The best solution
is to change the program to include this:

C/exec sql
C+ set option commit=*none
C/end-exec

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Fred Horvat
Sent: Friday, June 13, 2008 11:03 AM
To: RPG400-L@xxxxxxxxxxxx
Subject: Embedded SQL in RPG and Journaling Question

I have a monthly maintenance job that goes out to a file that our UPS
machines populate at the end of day with all the shipments via an ODBC
connection and purges records over 6 months old. The file is Journaled
and the program runs once a month. For about 2 years the program ran
fine. In December we upgraded our ERP package and as standard practice
we recompiled all our source members in out modification library to take
into account any file changes. During the ERP upgrade we added 3 more
fields to this file.
The program is an ILE RPG program with embedded SQL. It is rather
simple by comparing the transaction date to a date that is 180 days old
and deletes records older than that date.



Now when the program runs it will purge the records and then immediately
after the program ends Journaling reverses the changes. I did a
WRKACTJOB and can see the program run, then with Display File
Description I can see the number of records deleted increasing. When
the RPG program ends it immediately does a Journal Rollback. In
WRKACTJOB it says *ROLLBACK. After the job successfully ends there are
Zero deleted records and the original record count is the same.



What is causing this happen?



Fred Horvat

horvat@xxxxxxxx

216-426-5692

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.