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
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.