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



On 8/1/2014 8:51 AM, (WalzCraft) Jerry Forss wrote:
I want to create a "new" standard here in which all access to a file (Inquiry and Update) are done through a single pgm.
Let's call it FMMasterR for file MASTER.
My display pgm gets the record from FMMasterR. It is maintained and returned to FMMasterR as a DS (Parm_DS). I chain to MASTER receiving it into a Old_DS. I can compare Parm_DS to Old_DS to see that something changed. I can get the field names in the file easy enough loading into an array. What I want to do spin through the fields finding what changed. Something like
If Parm_DS.Field(1) <> Old_DS.Field(1). I then can write to a maintenance log of specific field changes. I know someone does field level maintenance logging so I am looking for some guidance on the best approach. Being I have the fields, length and pos I suppose I could try and compare doing a substring on the entire length of the file.
I am just playing and trying to come up with some ideas.

How do you envision reviewing the changes? How so you want to see them
presented? Assume for a moment we're thinking about a customer master
table with name, address, birth date, phone number and last change
timestamp. Customer signs in from the web and updates her phone number.
The row has a different phone number and change timestamp. What do you
want to be able to do with that information?

Do you want to accumulate statistics on which columns see the most
change activity?

Do you want a list of all of the customers who changed their phone
number in the last day/week/month?

Do you need a list of customers who moved to 02134 in the past
day/week/month?

Generally speaking, it seems to me that you probably don't want to
eyeball a printed list of each column that changed. What would be the
point? So, there is probably something more specific.

Also generally speaking, knowing the column that changed is pretty much
useless unless you also have the key to that row. So in our example,
even though a customer changed her phone number, you need the customer
number as well. And then there are 'useless' columns like the change
timestamp. These are useless for answering 'what changed' because they
always change. In other words, you wouldn't assert 'this row changed'
just because of the timestamp; there'd be something else in the row that
changed, something more interesting (like a phone number).

I have an in-house utility that compares two files column by column and
does in fact print out the differences. I use it for testing programs
that update. I eyeball the changes to make sure I've updated only the
columns I want, and with the values I expect. It's pretty sketchy in
terms of quality; I worked on it just enough to do what I want.

1) Extract column list from reference table
2) Extract column list from comparison table
3) Print rows added using supplied key fields
4) Print rows removed using supplied key fields
5) For matching rows, print columns which have different values. Print
keys, reference, comparison and additional columns (like customer name).
Ignore supplied 'don't care' fields like timestamps.

--buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.