	PROGRAM PBTEST
C
C
	LOGICAL*1 PB(6)
	LOGICAL PBSTAT
	INTEGER PBRAL
C
	DATA PB/'P','B',0,':',0,0/
C
	DO 10 I=1,8
	CALL CLOSE(4)
	PB(3)=I-1+48
	CALL ASSIGN(4,PB,4)
	CALL PBSET(4,IER)
	IF(IER.NE.1) GO TO 500
10	CONTINUE
	WRITE(5,20)
20	FORMAT(/'$TYPE <CR> TO CONTINUE:')
	READ(5,30) I
30	FORMAT(A2)
C
C
	DO 50 I=1,8
	CALL CLOSE(4)
	PB(3)=I-1+48
	CALL ASSIGN(4,PB,4)
	CALL PBCLR(4,IER)
	IF(IER.NE.1) GO TO 500
50	CONTINUE
C
C
	WRITE(5,20)
	READ(5,30)
C
C
	DO 100 I=1,8,2
	CALL CLOSE(4)
	PB(3)=I-1+48
	CALL ASSIGN(4,PB,4)
	CALL PBSET(4,IER)
	IF(IER.NE.1) GO TO 500
100	CONTINUE
C
C
	DO 200 I=1,8
	CALL CLOSE(4)
	PB(3)=I-1+48
	CALL ASSIGN(4,PB,4)
	IF(PBSTAT(4,IER)) WRITE(5,210) I-1
210	FORMAT(' PB #',I2,' IS ON')
200	CONTINUE
	CALL PBRAL(4,,,IVAL)
	WRITE(5,300) PBRAL(4),IVAL
300	FORMAT(/' FUNCTION PBRAL, STATUS VALUE [OCTAL]: ',O6,3X,O6)
C
C
1000	CALL EXIT
C
C
500	WRITE(5,510) IER
510	FORMAT(' *** ERROR: ',O7)
	GO TO 1000
	END