	SUBROUTINE SEARCH(FILNM,STBLK,LENGTH,BLKNO,VAR,WBLK,E2)
	BYTE FILNM(8),A(2),TFILE(8)
	INTEGER*2 DP(2048),C,E,ADD,STBLK,BLKNO,WBLK,E2,DATE
	LOGICAL VAR
	COMMON /DAT/DATE
	COMMON DP
	EQUIVALENCE (C,A(1))
	N=0		!N IS NUMBER OF BLOCK MINUS 1
	LI=0		!INITIALISE SUBSCRIPT
2	LI=LI+1
	E=-NUMB(DP(LI))	!!
	ADD=-NUMB(DP(LI+4))	!NUMBER OF ADDITIONAL ENTRIES
	STBLK=DP(LI+1)
	LI=LI+5		!POINTS TO FIRST FILE NAME
	DO 200 K=1,E
	IF(DP(LI).EQ.0)GOTO 85	!EMPTY FILE ?
	LENGTH=-NUMB(DP(LI+4+ADD))
	IF(LENGTH.GT.481)GOTO 199	!TENTATIVE ENTRY
	DO 300 I=1,7,2
	C=ICON(DP(LI))
	TFILE(I)=A(2)
	TFILE(I+1)=A(1)
	LI=LI+1
300	CONTINUE
C TEST AGAINST INPUT FILE
	DO 400 I=1,8
	IF(TFILE(I).EQ.FILNM(I))GOTO 400
	GOTO 75
400	CONTINUE
	VAR=.TRUE.
	DATE=DP(LI)
	WBLK=N+1		!BLOCK ENTRY IS IN
	E2=K			!NUMBER OF ENTRY
	GOTO 1000
75	STBLK=STBLK+(-NUMB(DP(LI+ADD)))
	LI=LI+ADD+1
	GOTO 200
85	STBLK=STBLK+(-NUMB(DP(LI+1)))
199	LI=LI+2
	IF(LENGTH.GT.481)LI=LI+3+ADD
	LENGTH=0
200	CONTINUE
C SEARCH NEXT BLOCK
	N=N+1
	LI=N*256
	IF(N.LT.BLKNO)GOTO 2
	VAR=.FALSE.
1000	RETURN
	END
