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



If you have journal receivers, and if you save the before and after images,
the code is not difficult. The key is understanding the contents of a
journal receiver entry.

Try this:
1) Using DSPJRN, pull the UB, UP, PX, and DL record types into a file with
a record length 125 (IIRC) + the length of the journaled file
2) For an add, you'll see a PX entry type.
3) For a delete, you'll see a DL entry type.
4) For an update, you'll see two entries: UB (the before image) and UP (the
after image) entry types.

As you read through the journal receiver data, move UB's JOESD
("entry-specific data") field into one data structure defined by the PF
you're examining. Each JOESD value is the "program-defined" record
image--the data isn't defined in columns, just a string of bytes. Taking
that data and dropping it into a data structure provides field-level
access. Move the UP's JOESD into another data structure defined by the PF
you're examining. At this point, you have your before and after fields in
separate data structures; all you have to do now is write the logic to
compare data structures.

Using SQL to extract the journal contents is far easier than DSPJRN
especially if you want to vary the selection criteria (like activity date).

If you don't save both before and after record images, the task becomes a
bit more complicated. You may have to read through a lot of journal
receivers to find more than one "UP" entry for a given record and then
compare a given UP with its previous UP. Another option is to compare each
"UP" record to the record in the database; the last UP should correspond to
the current database entry.

Programs like this scream "quick and dirty" and I'm here to tell you not to
give in. When I'm debugging a dispatch program that updates 30 tables, a
clean, high-functioning utility program to list the entries and
identify the changed columns is extraordinarily useful (there's no reason
you can't handle multiple tables--each receiver entry has the table name
and library). I've used such programs for training users--it's a concise
way to explain what's going on under the covers and, on more than one
occasion, a user has identified a defect.

On Wed, Aug 21, 2024 at 1:19 PM a4g atl <a4ginatl2@xxxxxxxxx> wrote:

I will be building the file from the journal receivers. I have my own
utility to build the fields from the receiver.

I am trying to compare record n-1 with record n.

Darryl.


On Wed, Aug 21, 2024 at 3:09 PM Rob Berendt <robertowenberendt@xxxxxxxxx>
wrote:

But going back to your original question: How to compare files.
I think there's a UNION or something I've seen where two files are
compared
and will show you inserts, deletes modifications.
As far as from whom, when, where that's not part of that equation.

On Wed, Aug 21, 2024 at 2:12 PM a4g atl <a4ginatl2@xxxxxxxxx> wrote:

Is there a simple way to compare records in a file?
I need to find where a field changed and was wondering if there is a
way
using SQL to identify changes?
I need to search several thousand records for where a field may have
changed.
I am harvesting the journals we have on all files.

Hoping I do not have to write code to achieve this.

TIA, Darryl Freinkel
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related
questions.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



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.