#!/bin/sh

# Check SAS log files for warning, errors, and other possible
# problems. --KDN

ME=`basename $0`

case $# in

  0)
  echo -e "------------------------------------------------------------------------------"
  echo "$ME: check SAS log files for warnings, errors, and possible problems. "
  echo "Usage: $ME [FILE]"
  echo "   For example: $ME *.log will check all log files in the current directory."
  echo "                $ME mysas.log will just check just the mysas.log file."
  echo "by Kent Nassen, last update: 06JAN2009"
  echo "------------------------------------------------------------------------------"
  echo ""
  ;;

  *)
  for fname in $*
  do
    grep -E -H -n -i "warning:|error:|uninit| 0 obs|no obser|repeats of|not found|not valid|invalid|syntax error|overwritten|converted|missing values were generated|outside the axis range|duplicate by var|not created|contained a missing" ${fname}
  done
  ;;
esac
