: /bin/sh ################################################################# # batch file for tec detail records # CUSTOMDESC # CUSTOMDEF progname=$0 SDATE=$1; EDATE=$2; STIME=$3; ETIME=$4 if [ -n "$5" ]; then SITEID=$5 fi EXCL_PAR_LIST='"UNA", "TLM"' # MTL, TLM EXCL_SITEID_LIST='104, 201' echo "SDATE=$SDATE" echo "EDATE=$SDATE" echo "STIME=$STIME" echo "ETIME=$ETIME" echo "SITEID=$SITEID" if [ -n "$6" ]; then P6=$6 else P6="" fi ################################################################# lastdayinmonth() # Returns the last day in month, Inputs: $1=mm $2=yyyy { cal $1 $2 | awk '{ if ( NF > 0 ) x=$NF } END { print x }' } ################################################################# # MAIN TMPSTABLE="tec9$LOGNAME" tmpfile=/tmp/tec_$$ tmpfile0=/tmp/tec0_$$ tmpfile1=/tmp/tec1_$$ tmpfile2=/tmp/tec2_$$ rm -f $tmpfile rm -f $tmpfile0 rm -f $tmpfile1 rm -f $tmpfile2 ######## #Testing #SDATE="01/11/2004" #EDATE="30/11/2004" ######## if [ -z "$SITEID" ]; then echo "Enter siteid (Enter for ALL):\c"; read SITEID fi if [ -z "$SITEID" ]; then SITEID="ALL" fi if [ -z "$SDATE" ]; then echo "Enter start date:\c"; read SDATE fi if [ -z "$EDATE" ]; then echo "Enter end date:\c"; read EDATE fi #if [ -z "$STIME" ]; then # echo "Enter start time:\c"; read STIME #fi #if [ -z "$ETIME" ]; then # echo "Enter end time:\c"; read ETIME #fi if [ "$SITEID" = "ALL" ]; then SITEBIT="" else SITEBIT="and siteid = $SITEID" fi # send file to user #exec 1>$tmpfile 2>&1 ( runisql 2>&1 <&1 <&1 <>$tmpfile2 cp $tmpfile1 tec9.1a # XX - extension from current directory where TEC is BLANK runisql 2>&1 <>$tmpfile2 cp $tmpfile1 tec9.1b # NN - extension from summary data where group is different runisql 2>&1 <>$tmpfile2 cp $tmpfile1 tec9.1c # sort so they are in par,eggrid,extn, order sort $tmpfile2 >$tmpfile0 # output to user #cat $tmpfile | pr_rep system tec_ cp $tmpfile0 r9.in rm -f $tmpfile rm -f $tmpfile0 rm -f $tmpfile1 rm -f $tmpfile2 ) | tee $0.log exit 0