      SUBROUTINE GETDAT
      character*80 LINE, GETNAM
      include 'MOP6FILE'
************************************************************************
*
*   GETDAT READS ALL THE DATA IN ON CHANNEL 2, AND WRITES IT TO SCRATCH
*   CHANNEL 5.  THIS WAY THE ORIGINAL DATA-SET IS FREED UP AS SOON AS
*   THE JOB STARTS.
*
************************************************************************
      data I/0/
      save I
C#      write(MIOB,*) GETNAM('FOR005')
      open(unit=MIOK,file=GETNAM('FOR005'),status='UNKNOWN')
C
C  CLOSE UNIT 5 IN CASE IT WAS ALREADY PRE-ASSIGNED.
C
      close (unit=MIOA)
      open(unit=MIOA,status='SCRATCH')
      rewind MIOA
      rewind MIOK
   10 READ(MIOK,'(A80)',end=20,ERR=20) LINE
      I=I+1
      write(MIOA,'(A80)') LINE
      go to 10
   20 rewind MIOA
      if (I.LT.3) then
         write(MIOB,'(A)') ' INPUT FILE MISSING OR EMPTY'
         call filclo  ! J/M
         stop ' in GETDAT - missing or empty input'
      end if
      close (unit=MIOK)
      end
