	PROGRAM MULWRT

C	THIS TEST TASK WILL WRITE A MESSAGE (100 A's) TO THE QUEUE A 
C	SPECIFIED NUMBER OF TIMES.  THE USER ENTERS THE NUMBER OF TIMES 
C	TO WRITE THE MESSAGE AND THE NAME OF THE MESSAGE ID.

	PARAMETER	LUN = 1
	PARAMETER	IEFN = 1
	PARAMETER	BYTCNT = 100
	PARAMETER	ITYPE = 0
	INTEGER*2	TIMES
	BYTE		MSGID(16)
	BYTE		BUFF(100)
	
	INTEGER*2	STATUS
	BYTE		STATB(2)
	EQUIVALENCE(STATUS,STATB)
	INTEGER*2	WRITEQ

	DATA	BUFF	/100*'A'/

	WRITE (5,1000) 
1000	FORMAT (' ENTER NUMBER OF TIMES TO WRITE: '$)
	READ  (5,1001) TIMES
1001	FORMAT (I5)

	TYPE 1002
1002	FORMAT(' ENTER MESSAGE ID (MAX 16 CHAR): '$)
	READ(5, 1003)IL,(MSGID(I),I=1,IL)
1003	FORMAT(Q,<IL>A1)
	DO 1004 I=IL+1,16
		MSGID(I) = ' '
1004	CONTINUE

	DO 2000 I=1,TIMES

  	STATUS=WRITEQ(LUN,IEFN,MSGID,BUFF,BYTCNT,ITYPE)
 	IF(STATUS .NE. "401)THEN
 		TYPE *,' BAD QUEUE  STATUS ON WRITE'
 		TYPE *,' DIRECTIVE STATUS: ',STATB(1)
 		TYPE *,' I/O STATUS: ',STATB(2)
 	ELSE
		TYPE *,' SUCCESSFUL WRITE'
 		TYPE *,' DIRECTIVE STATUS: ',STATB(1)
 		TYPE *,' I/O STATUS: ',STATB(2)
 	ENDIF

2000	CONTINUE

	END
