	PROGRAM		JBTEST
	PARAMETER	(MAXDTA = 100000)
	CHARACTER*256	filnam
	CHARACTER*72	parms
	REAL*8		data (MAXDTA)
	LOGICAL		morstn, morprm
C--------------------------------------------------------------------
	ifn = 11
1	WRITE (6,*) ' Enter the BUFR file name'
	READ (5,1000) filnam
1000	FORMAT (A)
	IF ( filnam .eq. ' ' ) STOP
	CALL JB_OPEN ( filnam, ifn, ier )
	IF ( ier .ne. 0 ) THEN
	    WRITE (6,*) ' Error opening file, IRET = ', ier
	    GOTO 1
	END IF
	morstn = .true.
	DO WHILE ( morstn )
	    CALL JB_NEXT ( ifn, iymdh, ier )
	    IF ( ier .ne. 0 ) THEN
		WRITE (6,*) ' No next station, IRET = ', ier
		morstn = .false.
	    ELSE
		WRITE (6,*) ' YYMMDDHH = ', iymdh
		morprm = .true.
		DO WHILE ( morprm )
		    WRITE (6,*) ' Enter next for next station,'
		    WRITE (6,*) ' Enter stop to stop, or'
		    WRITE (6,*) ' Enter parameter string:'
		    READ (5,1000) parms
		    iqs = INDEX ( parms, 'stop' )
		    iqn = INDEX ( parms, 'next' )
		    iq = iqs + iqn
		    IF ( iq .eq. 0 ) THEN
			CALL JB_READ ( ifn, parms, MAXDTA,
     +					data, np, nlv, ier )
			IF ( ier .ne. 0 ) THEN
			    WRITE (6,*) ' JB_READ error, iret = ',
     +				        ier
			ELSE
			    indx = 0
			    DO l = 1, nlv
				istop = indx + np
				istrt = indx + 1
				WRITE (6,2000) l, ( data (jj),
     +					jj = istrt, istop )
2000				FORMAT ( I4, ') ', 6 (X,1PE12.4) )
				indx = indx + np
			    END DO
			END IF
		    ELSE IF ( iqs .ne. 0 ) THEN
			morprm = .false.
			morstn = .false.
		    ELSE 
			morprm = .false.
		    END IF
		END DO
	    END IF
	END DO
	CALL JB_CLOS ( ifn, ier )
	STOP
	END
