Professional Documents
Culture Documents
by Dean Griffith
This utility gets around having to copy together two files that are the same and have
duplicate keys.
I have created a utility that will merge any two keyed physical files on the AS/400 or
iSeries. This is something that will get around copying together two files that are the same
and have duplicate keys.
This utility uses a psuedo type of AI, as it figures out what the keys are for the file, creates
an RPG program on the fly, compiles it and executes it to merge the two files. It has saved
us many times when wanting to update a file with data but also save the old or new
depending on which is the receiving library.
This utility uses a prompt screen that allows the user to only have to type in the file name
and the From and To library name and press F6 to submit the job. Presto Mergeo -- and it is
done.
Below are links for PDF documents for each source and one Word document needed for the
Message file that needs to be set up.
The program MRGFILR1 is the Prompt screen program. This is where the user types in the
file name and the From and To library. Most everything is self-explanatory on how to use it
and what it does.
Just setup the source and compile, the MRGSKEL cannot be compiled, as it is what is used
to create the program on the fly and it is commented to that fact.
Have fun.
Source files and Word document
CMSGLE
MRGCKFLCL
MRGCMPL
MRGCRTCL
MRGFILDF
MRGFILECL
MRGFILR1
MRGGENPGM
MRGMSGF
MRGSKEL
MRGSUBMIT
SMSGLE