C
C	Subroutine returns day of week as an integer.
C
C	Variables are: BIN_DATE..... Binary date to convert
C	               DAYOFWEEK ... Day of week (Sunday=1...Saturday=7)

	SUBROUTINE DAYOFWEEK(BIN_DATE,WEEKDAY)

	INTEGER*4 BIN_DATE(2)
	INTEGER*4 WEEKDAY,DAYNUM

	CALL LIB$DAY(DAYNUM,BIN_DATE)
	WEEKDAY = MOD(DAYNUM+3,7)+1

	RETURN
	END
