generate report based on data in files.

Hi All,
I need to develop a shell script which does sanity check of a data file, as below.

  1. For DATE columns, it should check if date is given in proper format or not? For example, if format of date is expected as DD-MON-YYYY HH24:MI:SS and we received the date in formation like DDMMYYYY HH24, then it is invalid.
  2. For NUMERIC columns, it should check if the numeric value is in given format or not. For example, if expected formart is 9999.99 and we received it as 9999 or expected format is 9999 and we received it in 9999.99 then it is invalid. (it is also possible that sometime we accept 9999 and 9999.99)
  3. For character column, it should check, the maximum length.
    For all above 3 critetia, we also need to check if NULL values are expected or not. For example, one column which contains date, it should check the format of date as well as if any row has NULL value or not.
    At the end, it should generate the report.
    I am able to achive the 3rd and 2nd scenarios. But am not able to find solution for DATE columns. In past i have done it using ckdate function, available in UNIX< but in my current UNIX version, ckdate is not installed and i want to make this script as generic, so that it does not depend on any in-built function.

Maybe something with awk:

echo "11-SEP-2001 08:46:00" | awk '{ if (match($0, "[0-3][0-9]-[[:alpha:]][[:alpha:]][[:alpha:]]-[0-9][0-9][0-9][0-9] ..:..:..$")) print "OK" }'

Or even egrep?

[mute@geek ~]$ echo "11-SEP-2001 08:46:00" | egrep -q '^..-...-.... ..:..:..$'; echo $?
0

Edit to suit..