When i compare two files using CMPPFM command, i am getting message as request failed. This is because files were having huge volume of data. It was showing file exceeds 112498 records. Is there any other way to compare files of large volume of data in AS400. Please let me know.

Answer Wiki

The size limitation is a known issue with the CMPPFM command.
I have split the large files into smaller files when I needed to do that in the past.
If you not worried about the sequence of the data, just what records are in one file but not the other, you can do that with SQL.
I keep all my source in QSQLSLC. Here is an example.
LMK if you need more information.
<pre>
INSERT INTO WRKENCRPT/ADDPF
(SYS, PRN, AGT, ACCTNO, CLIENT,
STRTDAT, ENDDAT, CHGDAT, USRPRF)
SELECT SYS, PRN, AGT, ACCTNO, CLIENT, STRTDAT,
CURDATE(), CHGDAT, USRPRF FROM WRKENCRPT/ACCTMSTR A
WHERE CLIENT <> ‘1379’ AND
NOT EXISTS (SELECT * FROM
ICULIB/ACCTMSTR B WHERE A.ACCTNO = B.ACCTNO AND
A.SYS = B.SYS AND A.PRN = B.PRN AND A.AGT = B.AGT);</pre>

I agree to TechTarget's Terms of Use, Privacy Policy, and the transfer of my information to the United States for processing to provide me with relevant information as described in our Privacy Policy.

I agree to my information being processed by TechTarget and its Partners to contact me via phone, email, or other means regarding information relevant to my professional interests. I may unsubscribe at any time.

Processing your response...

Discuss This Question: 7 &nbspReplies

There was an error processing your information. Please try again later.

I agree to TechTarget's Terms of Use, Privacy Policy, and the transfer of my information to the United States for processing to provide me with relevant information as described in our Privacy Policy.

I agree to my information being processed by TechTarget and its Partners to contact me via phone, email, or other means regarding information relevant to my professional interests. I may unsubscribe at any time.

Although the CMPPFM command can run against PF-DTA file members, the help text should make it clear that it is intended as a source comparison tool. The first line of help text:

This command allows you to compare source physical file members.

Source file members with more than 112498 records are indeed excessive, though not impossible nor unheard of.
First, are these actually source files or are they database files? If these are source files, you might be better off using the cmp - Compare two files Qshell utility. Actually, that might also be better for database file comparison, though I'd always be wary of any comparison tool for those.
Such comparisons are generally made on a line-by-line basis with no field-level interpretation. One file might have a 2-byte character field beginning in, say, position 10 of the buffer. The second file might have a 16-bit integer field in the same buffer position. Both files might have x'4040' at that position, but the data is definitely different -- blanks in the first file and numeric 16448 in the second file. The record formats are not considered in the comparison.
What exactly are you trying to accomplish? What business problem are you needing to solve? Those are usually easier questions to answer than trying to say how to use a particular tool for what might not be appropriate.
Tom

writing an RPG program for this…
I probably agree (with possible exceptions depending on exactly what is being done.)
The two files could be read into data structures record by record. As long as the DSes matched, the next records from the files would be read.
Upon mismatch, some kind of logic would need to decide which was read next.
It'd almost be a 'matching records' function, but sort sequencing could be a big problem. If this is merely some kind of textual data stored in source members, sorting might make no sense. Then again, sorting might be manipulated in views that might simplify some logic.
Without knowing what needs to be accomplished, it's hard to guess.
Tom

writing an RPG program for this…
lots to consider when trying to do these functions once you move outside a simple binary compare. Unless there's some kind of spec it can turn into a GGM (*)
Is it text? is it numeric, is it field by field or merely inserted / de;eted records - what if they are moved in sequence? what if text changes case? etc etc
(*) - Great Grimpen Mire - one step off the path that no-one knows is there and you sink)

We can achieve this by using SQL query. Something like this will work Select * from file1 where field1||field2||field3 not in (select a.field1||a.field2||a.field3 from file2 a) . Write the query in reverse way also to find those records in file2 but not in file1

I agree to TechTarget's Terms of Use, Privacy Policy, and the transfer of my information to the United States for processing to provide me with relevant information as described in our Privacy Policy.

I agree to my information being processed by TechTarget and its Partners to contact me via phone, email, or other means regarding information relevant to my professional interests. I may unsubscribe at any time.

Processing your reply...

Ask a Question

Free Guide: Managing storage for virtual environments

Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!

To follow this tag...

I agree to TechTarget's Terms of Use, Privacy Policy, and the transfer of my information to the United States for processing to provide me with relevant information as described in our Privacy Policy.

I agree to my information being processed by TechTarget and its Partners to contact me via phone, email, or other means regarding information relevant to my professional interests. I may unsubscribe at any time.