@Patrick The log scan originated from a peculiar issue we encountered when we FTP'd files from the MVS mainframe. Sometimes the download would be incomplete, but without a standard FTP error message, instead we'd get a proprietary response (in the 600 range IIRC) from the FTP server which SAS would include in the log, but without issuing a WARNING or ERROR.
It seemed to be that, although the previous job creating the file had successfully finished, MVS was still doing some "housekeeping" with its catalog when we tried to read the file.
Anyway, in such a case I would rerun the SAS program and keep a counter for the repeats. If that exceeded a certain threshold, I would exit the script with a dedicated exit code so the operators immediately knew what to look for. In RL, we never got that far. Usually the issue was "fixed" on the MVS side with the first rerun.
There might even have been a SAS option for this situation, but since I know quite a bit about UNIX shell scripting, that was the easier way to go. As of now, the issue is moot as we haven't been using FTP for a long time. The "mainframe" now runs as some kind of emulator on a Linux instance, so ssh is available OOTB. Which opened another can of worms, because the SAS implementation of SFTP is (was?) not reliable at all. Ask if you want to know more.
Once I had the log scan established, it was rather easy to extend it for other issues SAS would not catch on its own.
... View more