C   14/03/84            MEMBER NAME  DATE     (S)           FORTRAN
C   30/03/79 306031652  MEMBER NAME  DATE     (S)           FORTRAN
      INTEGER FUNCTION DATE(DUMMY)
C---  PROVIDE DATE AS I*2-WORD ACCORDING TO DDMMY, SO THE MAXIMUM
C     VALUE COULD BE 31129 (31.12.1979)
C
C     H.WRIEDT    13.03.79      18:10
C     LAST MODIFICATION     27.05.83       15:45
C
      IMPLICIT INTEGER*2 (H)
C
      INTEGER IINDEX, BINREP(8), RETC
      LOGICAL*1 CHREP(119)
C
      DIMENSION HDATE(3)
C
      DATA NERR/0/
C
C---  GET PRESENT DATE
      IINDEX = 0
      CALL CALDAT (IINDEX, CHREP, BINREP, RETC)
      IF (RETC.GT.0) GOTO 100
C---  DAY
      HDATE(1) = BINREP(1)
C---  MONTH
      HDATE(2) = BINREP(2)
C---  YEAR
      HDATE(3) = BINREP(3)
C---  PREPARE OUTPUT DATE
      HY1 = HDATE(3)/10
      HY2 = HY1*10
      DATE = HDATE(1)*1000 + HDATE(2)*10 + HDATE(3)-HY2
      RETURN
C---  ERROR MESSAGE FROM CALDAT
  100 DATE = 0
      IF (NERR.GT.5) RETURN
      NERR = NERR + 1
      WRITE(6,600) RETC
  600 FORMAT(' **** ERROR MESSAGE FROM F22HOW.JADEGAMS(DATE):',
     &       ' CALL CALDAT LEADS TO ERROR-CODE',I6/
     &       '      LOOK ITS MEANING UP WITH H CALDAT, PLEASE')
      RETURN
      END
