I am thinking of an RPG where the two files can be compared and
if any differences found, write the to a third file.
Or should I use embedded SQL?
First create a CL-program which copies both files via ddm, to files in
xxlib.
Then compare each record. I tried the Iseries command cmpfile but this is
useless.
Regards,
René
On Fri, 10 Oct 2003 18:09:54 +0200, "René E. Breedveld"
<mrsc@_no_spam_xs4all.nl> wrote:
>Then compare each record. I tried the Iseries command cmpfile but this is
>useless.
I have found that the OS/400 command CMPPFM works well if the record
length is not too long and the members do not have too many records.
Ken
http://www.ke9nr.net/
Opinions expressed are my own and do not necessarily represent the views of my employer or anyone in their right mind.
We have had a system crash and had to do a reload.
Because we mirrored our production files with mimix, after the reload we
restored the files from our fallbackmachine.
After a few days we noticed some corrupted files between the restored
machine and an other production machine.
After some checking we discoverd that mimix didn't replicate the files
correctly without displaying any errors.
So now we'll have to compare the files from the two production machines to
discover corrupted files.
Because we have files with over 60000 records we must find/develope a tool
which reads two files from the production data,
compare them and write differences to a third keyed file. So that we can use
the third file for recover actions.
The CMPPFM can't handle this the correct way.
I think the only way is to use RPG comparing both files and write
differences to a third.
While I am just a hobby system (programmer) I can't figure out how to
program this in RPG or CL.
Because of the large files I think a combination of RPG and maybe SQL would
give the fastest throughput.
Two files as read, rename the fields, compare and write to outfile.
Do I have to use a datastructure or embedded SQL or .......
/René
"Ken" <ng3122@ke9nr.#nospam#.net> wrote in message
news:jj0fovci88e9v0i6s...@4ax.com...
"René E. Breedveld" wrote
On Sat, 11 Oct 2003 18:03:16 +0200, "René E. Breedveld"
<mrsc@_no_spam_xs4all.nl> wrote:
>Two files as read, rename the fields, compare and write to outfile.
>Do I have to use a datastructure or embedded SQL or .......
I'm not familiar with the Mimix product, however if it works off
journal receivers like Vision, the files should be identical at a
relative record number level. To check this, you definitely want to
stay away from SQL or anything else like that which has access
optimization.
I think you could check all files with the same RPG program using
program-described files. Have file1 and file2, both with whatever the
longest record length is of any your files. Read both files in tandem
in arrival sequence. Use a file information data structure with each
file so that you can keep track of the record numbers to tell if any
deleted records were skipped. Pass in the record length as a
parameter. Compare that number of bytes of record data from the
files.
Print error messages for any records that are deleted in one file but
not the other, for any extra records that are in one file but not the
other, and anytime there is a data mismatch.
You could write all of the identical records to a program-described
output file, including or not including any differences, whatever you
need.
Before running the program, override file1 to the file from the one
system and file2 to the file from the other system.
If you want an output file, use CRTDUPOBJ to create an empty duplicate
and override your program-described output file to it.
Hopefully this gives you some ideas on how to roll your own file
compare program.
TAATOOLs library has a CMPDBF command that prints difference in two files.
If you buy their product you get the source which you could probably adapt.
If you want to do your own in RPG IV, I think I'd approach it by reading the
same file twice into my program. You'll need to rename the record format.
You'll need to rename the fields using PREFIX on the F spec. Create
externally defined data structures for each of record and then you can
compare for inequality by comparing the data structures in in one statement.
Sam
"René E. Breedveld" <mrsc@_no_spam_xs4all.nl> wrote in message
news:1065888202.362684@cache2...
Sam
"Saml" <no...@nonesuch.com> wrote in message
news:4G0ib.142$T82....@eagle.america.net...
That would be very usefull, the thing is I do some programming myself.
But first of all I am a system manager, and I develope system management
tools.
The program I need is normally I program which should be created by an
application programmer.
I understand RPG and can enhance sources but pure creating such a tool as
this from the blank, is a bit out of my reach.
I know what should be in it but I need samples how to create two
datastructures from two identical files, actually three (one output).
Thanks in advance,
René
"Saml" <no...@nonesuch.com> wrote in message
news:uP1ib.147$T82....@eagle.america.net...
Seems they would have already written these tools
for both testing their own software (I hope)
and assisting in customer system recovery.
"René E. Breedveld" <mrsc@_no_spam_xs4all.nl> wrote in message
news:1065971963.142988@cache1...
/René
"*NONE" <spa...@this-address.com> wrote in message
news:4Ceib.15817$hp5.1841@fed1read04...
Sam
"René E. Breedveld" <mrsc@_no_spam_xs4all.nl> wrote in message
news:1065971963.142988@cache1...
it should work:
mr...@nospamxs4all.nl or try rene.br...@nospambeers.nl
Remove the word nospam
thanks in advance.
Regards,
René
"Saml" <no...@nonesuch.com> wrote in message
news:dYhib.185$T82....@eagle.america.net...
Sam
"René E. Breedveld" <mrsc@_no_spam_xs4all.nl> wrote in message
news:1066075002.370926@cache2...
How many files You want compare?
Do You want compare each record in file?
Regards
Leszek G.
Thanks again for your tool, it works fine and good documented too!
/René
"Saml" <no...@nonesuch.com> wrote in message
news:rhJib.256$T82....@eagle.america.net...
Sam
"René E. Breedveld" <mrsc@_no_spam_xs4all.nl> wrote in message
news:1066418867.268483@cache1...