When looking for a comparison facility for Unix files, I stumbled across ISPF edit compare function.
If you are editing a file you can use the compare * command to show the changes you made to the file in the current session. This gave me
000001 line 1
====== line 3
.OAAAA line 2
.OAAAB line 4
.OAAAC line 5
- line 1 was unchanged
- line 3 was deleted
- line 2,4,5 were added
You can then use “mm” or “mdd …. mdd” prefix commands on the ====== to apply the changes to the file, and use “d” or “dd … dd” on the .O prefix lines to delete the lines.
You can use the compare command, and be prompted for options.
I specified a Unix file, and could see the differences.
You can set the exclude option (at the bottom of the panel), which says exclude all the lines, but display ‘n’ lines around changes, where ‘n’ is specified at the top of the panel.
I noticed that compare was display “blank” lines in Unix files as being changed. The original file had a null line, with just an end of line. When I customised the file and saved it, ISPF replaces an “end of line” with “blank end of line”. As these do not match, they show up as being changed.
The solution is to edit the original file with null lines, make a dummy change, and save the file. The file will no longer have null lines, and only your changes will be visible.
ASCII files in OMVS
I found I was unable to compare python source files in OMVS, because they were ASCII files. (When the files were tagged as ASCII, I could edit them).
You cannot use ISPF compare if the files are ASCII (non EBCDIC). You can do
- iconv -f ISO8859-1 -t IBM-037 ascii_file1 > ebcdic-file1
- iconv -f ISO8859-1 -t IBM-037 ascii_file2 > ebcdic-file2
Compare the files then use the following to transform them back.