	SUBROUTINE FULLTBL(*)
C
C Subroutine to print tables of selected entries
C
	include 'logic.common'
	INTEGER STATUS
	INTEGER*2 ISET,ICARD
	INTEGER*4 NAMREC,FULREC,DIREC,ISEQ,JCARD
	CHARACTER*1 QM,ans
	CHARACTER*80  BUFFER(135)

C---------------------------------------------------------------------------
C initialize the full PDF-2 database, if not yet done
	IF (.not. initPDF2) then 
	  write (lo,'(a)') ' Initializing PDF-2 database'
	  CALL RET3_INIT(STATUS,PDFDISK,PDFCDROM,PDFLOCAL,LPDF2,LPDF2L)
	  IF (STATUS .NE. 0) then
	    write (lo,'(A)') ' WARNING -- Unable to open PDF-2 database',
	1	'$Press RETURN to continue: '
	    read (li,'(A)') ians
	  ENDIF
	  INITPDF2 = .true.
	ENDIF
       IF (.not. (PDFDISK .or. PDFCDROM)) THEN
	  write (lo,'(A)') ' WARNING -- Unable to print entries:'//
	1  ' No PDF-2 database','$Press RETURN to continue: '
	  read (li,'(A)') ians
	  RETURN
	ENDIF

	type *,'printing full tables...'
	call opnpr(lo,li,lp,'LOGIC.LIS',ncol,nlines)
	IPAGE = 0
	ICARDNO = 0 

	WRITE(lp,721) 1
	IPAGE = 1
	WRITE(lp,810) (i,CONTEXT(i)(1:clen(i)),i=1,cnum)
810	FORMAT('    Commands: ',i3,') ',a,/,99(14x,i3,') ',a,:/))

	DO 10 N=N_Lwords,1,-1
	  NTABLE = TABLE(N)
	  IF (NTABLE.EQ.0) GOTO 10
	  DO J=31,0,-1
	    IF (IBITS(NTABLE,J,1).EQ.1) THEN
C	convert bit# and word# to seq#
	      ISEQ = 32*(N-1) + J + 1
C 	get record numbers from seq#
	      READ (LUNM,rec=ISEQ) JCARD,NAMREC,FULREC,DIREC
	      ISET = JCARD / 10000
	      ICARD = MOD(JCARD,10000)
	      ICARDNO = ICARDNO + 1
	      if (mod(IPAGE,25) .eq. 0) then
		write(lo,819) IPAGE
819		format('$You have just printed',i4,' pages, continue? ')
		read (li,'(a1)',end=999) ans
		if (ans .ne. 'Y' .and. ans .ne. 'y') goto 999
	      endif
C---- read the pattern from the full database
	      CALL GETPAT (fulrec, BUFFER, NBYTES, STATUS)
	      IF (STATUS .EQ. 1) THEN
	        WRITE(lo,'(A,i7.6)') 
     1		' ERROR: unable to retrieve PDF-2 entry',JCARD
	        goto 5
	      ELSEIF (STATUS .EQ. 2) THEN
	        WRITE(lo,'(A,i7.6)') ' No PDF-2 entry exists for entry',JCARD
	        goto 5
	      ENDIF
	      CALL READBF (BUFFER, NBYTES, STATUS)
	      if (status .ne. 0) then
	        write(lo,28)
	        goto 5
	      endif
28	      format(' READBF ERROR -- unable to read Entry ',i6.6)
	      CALL ONCE
	      IPAGE = IPAGE + 1
	      WRITE(lp,721) IPAGE
721	      FORMAT('1',120x,'Page',i4)
	      CALL PDF2PRT(lp)
	    ENDIF
	  ENDDO
10	CONTINUE

999	CALL CLPR(lo,li,lp)
1	RETURN
5	CALL CLPR(lo,li,lp)
3	RETURN 1
	END

