      LOGICAL*1 LO1(6512)
C
      CHARACTER*3 C3
C
      EQUIVALENCE(LO1(1),C3)
C
      INCLUDE 'EDR:UNPACK.INC'
C
      OPEN(UNIT=1,FILE='EDR.DAT',TYPE='OLD',IOSTAT=IOS,
     O     FORM='UNFORMATTED',ORGANIZATION='SEQUENTIAL',
     O     ACCESS='SEQUENTIAL',RECL=1628)
C
      OPEN(UNIT=2,FILE='EDRCHK.DAT',TYPE='NEW',IOSTAT=IOS,
     O     FORM='FORMATTED',ORGANIZATION='SEQUENTIAL',
     O     ACCESS='SEQUENTIAL',RECL=80)
C
      TYPE *,' STAT ON OPEN = ',IOS
C
      IREC=0
      DO WHILE (IOS.EQ.0)
C
         IREC=IREC+1
         READ(UNIT=1,IOSTAT=IOS) LO1
         TYPE *,' STAT ON READ = ',IOS
         TYPE *,' LO1 = ', (LO1(K), K=1,20)
C
         IF (IREC.GT.2) THEN
C
      CALL UNPACK(LO1,ISTAT)
C 
C      WRITE(2,200)    PROJID,  RECID,   SCID, RECNUM, DATMOD,
C     H                EEXTFL, SCPLAB, RECTIM, ERTSHR, ERTSSC,
C     H                ERTSML,  YEAR1, DATSRC,  GOLAY, SEGNUM,
C     H                ERTEHR, ERTESC, ERTEML,  YEAR2, SWVERS,
C     H                SCETHR, SCETSC, SCETML,  YEAR3, SCEVFL,
C     H                CORRFL, MOD216,  MOD60, LINCNT, TELRAT,
C     H                EFFRAT, FORMID, BERTOL, DSNCON, RECAGC,
C     H                DSNNUM,   EBEC, SYMSNR, DECSNR, PHYSRN,
C     H                  DQSW,    DQI,    DPI,    GCI, DPIRIS,
C     H                GPIRIS, DRSDAT,  GCBEC, GBITES
C
C
C      WRITE(2,201) COMAND,  IBCOM,  OBCOM,  STAT1,  STAT2,
C     P             STATIM,    L63,    L64, LSTAT1, LSHORT,
C     P             ESTAT1, ESHORT, LSTAT2,  LLONG, ESTAT2,
C     P              ELONG,  MSTAT,      M,  LSTAT
C
C
      WRITE(2,202) PDIFF, PREF, SDIFF, SREF, OBHFM, IBHFM
C
  200 FORMAT(
     H' PROJID',A6 '  RECID',I6,'   SCID',I6,' RECNUM',I6,' DATMOD',I6/
     H' EEXTFL',I6,' SCPLAB',I6,' RECTIM',I6,' ERTSHR',I6,' ERTSSC',I6/
     H' ERTSML',I6,'  YEAR1',I6,' DATSRC',I6,'  GOLAY',I6,' SEGNUM',I6/
     H' ERTEHR',I6,' ERTESC',I6,' ERTEML',I6,'  YEAR2',I6,' SWVERS',I6/
     H' SCETHR',I6,' SCETSC',I6,' SCETML',I6,'  YEAR3',I6,' SCEVFL',I6/
     H' CORRFL',I6,' MOD216',I6,'  MOD60',I6,' LINCNT',I6,' TELRAT',I6/
     H' EFFRAT',I6,' FORMID',I6,' BERTOL',I6,' DSNCON',I6,' RECAGC',I6/
     H' DSNNUM',I6,'   EBEC',I6,' SYMSNR',I6,' DECSNR',I6,' PHYSRN',I6/
     H' DQSW(10)',10I6/' DQI(10)',10I6/' DPI(80)',8(/10I6)/
     H' GCI(80)',8(/10I6)/
     H' DPIRIS',I6,' GPIRIS',I6,' DRSDAT',I6,'  GCBEC',I6,' GBITES',I6)
C
C
  201 FORMAT(' COMAND',I6,' IBCOM',I6,' OBCOM',I6/
     P' STAT1(10)',10I6/' STAT2(10)',10I6/
     P' STATIM',I12,' L63',I6,' L64',I6,' LSTAT1',I6/
     P' LSHORT(64)',8(/8I6)/
     P' ESTAT1',I6,' ESHORT(16)',2(/8I6)/' LSTAT2',I6,' LLONG(64)',
     P  8(/8I6)/' ESTAT2',I6,' ELONG(16)',2(/8I6)/
     P' MSTAT',I6,' M(192)',24(/8I6)/' LSTAT',I6)
C
C
  202 FORMAT(' PDIFF(3,800)'/200(12I6/),' PREF(3,160)'/40(12I6/)
     M       ' SDIFF(3,400)'/100(12I6/),' SREF(3,80) '/20(12I6/)
     M       ' OBHFM(3,80) '/ 20(12I6/),' IBHFM(3,80)'/20(12I6/) )
C
         ENDIF
C
         IF(IREC.EQ.20) GO TO 50
      ENDDO
C
  50  TYPE *,' JOB DONE!'
      STOP
      END
