Without the whole script, its difficult to determine the exact error.
It is possible that that TMPREPFILE has to be exported.
Quote:
|
I am getting the msg can't open tmp_rep_{$day}.rpt.1
|
If this is the exact error message, then $TMPREPFILE is either re-defined, or non existent.