The Question is:
How can I make DCL DIFFERENCE output only statistics (just like DCL SEARCH
/WIN=0 or DCL DIR /NOHEAD/NOTRAIL) and not also the actual differences?
(We are using a commandprocedure which attempts to fill the void left by DIFF
not supporting wildcards by invoking DIFF for each file returned by
F$SEARCH(). Whenever DIFF encounters a non-ascii file - like an executable -
then the output of DIFF tends to
change the terminal settings because the terminal interprets the DIFF output
as control characters - I think. Just knowing that differences exist would
suffice for us with these files. Is it correct to test for whether a file is
an ASCII file or not usin
g the following expression
f$file(file,"RFM") .eqs. "FIX" .or. f$file(file,"RAT") .eqs. "RAT"?
Thank you very much.
The Answer is :
One option is to check the status returned from the DIFFERENCES command, like
$ DIFFER/OUTPUT=NL: file1.ext file2.ext
$ IF $STATUS .EQ. %X006C8009 THEN $ GOTO NO_DIFFERENCE
$ IF $STATUS .EQ. %X006C8013 THEN $ GOTO THERE_IS_A_DIFFERENECE
A little experimentation with different combinations of input files and the
resulting $STATUS values should enable you do do what you want.
(Note: the /NOOUTPUT qualifier does not supress output from DIFFERENCES!
That's why you have to use /OUTPUT=NL:)