iSeries home   |   Easy400     |   CGIDEV2     |   MMAIL  
Public-Source
 
Introduction
Command DSPSTMF
 Command CMPSTMF
String Retrieve/Replace/Extract  procedures
 
 PDF of this tutorial
 
 Download
 
 

 
 
 
WrkStmf
Command CMPSTMF (Compare stream files)
 

Command CMPSTMF compares two stream files and is able to detect the first non-matching character.
Restrictions:

  • Stream file with Unicode CCSID 1208 are not supported.
  • Maximum stream file size: 8 MB each.

Figure 1 - Command CMPSTMF
  • First stream file (STMF1) - The name of the first stream file to be compared. This name must be qualified with the name of the directory in which the stream file is located.
  • Second stream file (STMF1) - The name of the second stream file to be compared. This name must be qualified with the name of the directory in which the stream file is located.
Note - Each stream file must not exceed the size of 8 MB

Figure 2 - Example of command CMPSTMF
  • This screen displays the two stream files to be compared.
  • You may rollup, rolldown the stream file pages, and position to the first or to the last page.

How to perform the comparison between two stream files

Position to the first page (F7, if you need to), then press F5. The two stream files start to be compared.
You have two possible cases:
  • You receive a message of successful comparison. In this case you are over, the data of the two stream files perfectly match. Press F3 or F12 to exit.
  • You receive a message saying that a character mismatch has been detected. The message states the position of the two compared characters in the two files.
    Figure 3 - First data comparison
    In this case, the comparison is perfect up to the mismatching characters.
    Now it is up to you whether to look for further data matches.
Should you want to proceed in your investigation, this is how you do it:
  • Look for the next potential matching string in the two stream files.
  • Position the curson on the first character of such a string in the first file and press F4. In this way you force the next comparison to start from that first file position.
  • Position the curson on the first character of such a string in the second file and press F4. In this way you force the next comparison to start from that second file position.
    Figure 4 - Setting start positions for the next comparison
  • The press F5 to start the comparison from those starting positions.
  • Again, you receive a message saying whether the comparison was completed successfully, or it had to stop on a subsequent mismatching couple of characters. In case of mismatch, you may want to continue your investigation by proceeding in the same way as you did before.

Figure 5 - Final data comparison report