C	PROGRAM NBSREAD
C
C	TO READ THE FULL CRYSTAL-DATA DATA BASE IN ORDER TO DISPLAY
C	ALL OF THE CARDS ASSOCIATED WITH A PARTICULAR ENTRY
C
	CHARACTER*80 BUFFER
	BYTE IFILE
C
C
        WRITE(6,1000)
1000    FORMAT(' CODE TO DISPLAY CRYSTAL DATA DATABASE'/
     1  10X,'VAX VERSION SEPT 1, 1988'/
     1  10X,'LOCAL CHANGES MRL/PSU'/)
	WRITE (6,6)
6	FORMAT ('$(I)NORGANIC OR (O)RGANIC FILE [I] >>> ')
	READ (5,7) IFILE
7	FORMAT (A1)
	IF (IFILE.EQ.'O'.OR.IFILE.EQ.'o') THEN
	OPEN (UNIT=2,NAME='FULL_CD:CRYSTO.DIRECT',
	1 STATUS='OLD',READONLY,SHARED,
	2 ACCESS='DIRECT',FORM='FORMATTED',RECL=80)
	ELSE
	OPEN (UNIT=2,NAME='FULL_CD:CRYSTI.DIRECT',
	1 STATUS='OLD',READONLY,SHARED,
	2 ACCESS='DIRECT',FORM='FORMATTED',RECL=80)
	ENDIF
1	WRITE (6,2)
2	FORMAT ('$ENTER THE RECORD NUMBER: (CONTROL Z TO QUIT) ')
	READ (5,3,ERR=1,END=99) NREC
3	FORMAT (I)
	IF(NREC.LE.0) GO TO 99
C
C
	NSAVE=0
	IRECNO=NREC
50	READ (2,12,REC=IRECNO,ERR=1) BUFFER
12	FORMAT (A)
	DECODE (80,15,BUFFER(72:78)) N
15	FORMAT(I7)
	IF (NSAVE.EQ.0) NSAVE=N
	IF (N.NE.NSAVE) GO TO 1
	WRITE (6,25) BUFFER
25	FORMAT (1X,A)
	IRECNO=IRECNO+1
	GO TO 50
C
C
99	CLOSE (UNIT=2)
	STOP '                    END OF NBSREAD'
	END
