C Program gets one RSC-11-6 record, lists header to unit 10.

      character*128   filename        ! path to input file
      integer*4       iarray(1264)    ! input data record
      integer*4       irec            ! record number
      integer*4       narg            ! number of arguments
      integer*4       oarray(42)      ! output record of header data
      integer*4       ounit /6/       ! output logical unit
      character*80    string          ! misc string

      integer*4       iargc           ! function


C Get and process arguments; read data record

      narg = iargc()
      call getarg(1,filename)

      open ( unit = 31,
     *       file = filename,
     *       access = 'direct',
     *       recl = 5056,
     *       form = 'unformatted',
     *       status = 'old')

C      open ( unit = ounit,
C     *       file = 'rdhdr.out',
C     *       status = 'unknown')

      if ( narg .gt. 1 ) then
        call getarg(2,string)
        read(string,*) irec
      else
        irec = 1
      end if

      read(31,rec=irec,end=90) iarray


C Unpack header; print it

      call get_hdr(iarray,oarray)

      call prt_hdr0(ounit,oarray)

      go to 99

C Exits

 90   continue
      write(ounit,'("EOF trying to read record ",i10)')
     *      irec
      go to 99

 99   continue
      stop
      end
