      program iscbul

c list ISC bulletin fixed format files

      character*80 file_name, infile, exfile, root

      common joblog

      include 'basics.inc'

      include 'hold.inc'

c      character*6 chival
      
      integer*2 lenrot
      parameter (maxag=1000)
      character*6 agcode(maxag)

      stage = 'UNIX'

c     Sept 2003 changed from 682 to 680

      maxrec=680
            
      nover = 100
      base = secnds(0.)
      nout = 6
      nin = 8
      ntemp = 9
      joblog = 10
      mout = nout
      
      call setup (root, lenrot, exfile)
      
c open direct-access scratch file

      open(unit=ntemp,form='unformatted',status='scratch',
     1 access='direct',recl=96)
     
           
      if (mout .ne. nout) then
        open (unit=mout, file=exfile, status='new', iostat=ios)
        if (ios .ne. 0)
     2           call abort ('Unable to open output file '//exfile)
        inquire (unit=mout, name=file_name)
        print *, 'Output to '//file_name
      end if
      call setfis
      iymob = itchk(timlim(1)(1:6))
      iymox = itchk(timlim(2)(1:6))
      
      do while (iymob .le. iymox)
      
        call monfil (iymob, root(:lenrot), infile, lenin)

c July 16th 2003 - Peter - addition to bypass non-existent files
        
        if ( lenin .eq. 0 ) then
            print '(1x,a,i6)', 'No file exists for - ',iymob
        else        
            call dofile (infile(:lenin), agcode, maxag)
        end if
        
        iymob = nextmo (iymob, 1)
        
      end do
      call linbrk (mout)
      
c close the Direct Access temp file
      
      close (unit=ntemp) 
      
      
      print '(1x,a,f6.2,a)', 'Elapsed time',secnds(base)/60., ' minutes'
      stop
      end
