#!/usr/bin/ksh

if fileExists.pl STOPIWCP.DAT 

then

   exit;      # STOPIWCP.DAT exists. Halt the export process.

else
# print "Everything ran ok. Stopiwcp does not exist\n";
# print "Deleting FTPOK.DAT\n";

   rm -f FTPOK.DAT

fi  # end if

# -----------------------------------------------------
#  Run IWCP/Oracle Export Process 
# -----------------------------------------------------
#
  if /project/clearmark/iwcp/process/SAMIIProcess/export.pl
  then  # export process ran successfully
  else  # it did not work
  touch STOPIWCP.DAT;
  exit;
  fi # end if

  cp /incoming/iwcp/day6/INTREC*.DAT /incoming/iwcp/day7/
  cp /incoming/iwcp/day6/EXPCNTL.DAT /incoming/iwcp/day7/

  cp /incoming/iwcp/day5/INTREC*.DAT /incoming/iwcp/day6/
  cp /incoming/iwcp/day5/EXPCNTL.DAT /incoming/iwcp/day6/

  cp /incoming/iwcp/day4/INTREC*.DAT /incoming/iwcp/day5/
  cp /incoming/iwcp/day4/EXPCNTL.DAT /incoming/iwcp/day5/

  cp /incoming/iwcp/day3/INTREC*.DAT /incoming/iwcp/day4/
  cp /incoming/iwcp/day3/EXPCNTL.DAT /incoming/iwcp/day4/

  cp /incoming/iwcp/day2/INTREC*.DAT /incoming/iwcp/day3/
  cp /incoming/iwcp/day2/EXPCNTL.DAT /incoming/iwcp/day3/

  cp /incoming/iwcp/day1/INTREC*.DAT /incoming/iwcp/day2/
  cp /incoming/iwcp/day1/EXPCNTL.DAT /incoming/iwcp/day2/

  #delete INT files and EXPCNTL files?



