     	SUBROUTINE CODDAT( DAY, CDAY )
C
C  PROGRAMMER:  R.S. ZHOU
C		ALFRED UNIVERSITY,  FEB-1987
C
C	THIS ROUTINE DECODES D-500 SYSTEM DATE
C
     	CHARACTER DAY*9,DAT*6
     	CHARACTER*36 MONTHS
     	DATA MONTHS/'JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'/

     	DAY = '00-000-00'
     	IF( CDAY.GT.0.0 ) THEN
     	    IDAY = CDAY
     	    ENCODE( 6, 1, DAT ) IDAY
     	    DAY(1:2) = DAT(1:2)
     	    DECODE( 2, 1, DAT(3:4) ) IVAL
C S.Z.           ival = ival*3 - 2                  
     	    DAY(4:6) = MONTHS( IVAL : IVAL+2 )
     	    DAY(8:9) = DAT(5:6)
     	ENDIF
1	FORMAT(I6)
     	RETURN
     	END
