	SUBROUTINE CHECK_SUBMIT(submit_line,submit_lth,too_long)

	INTEGER*4 submit_lth, submit_beg, chunk_lth, icode
	CHARACTER submit_line*512, submit_chunk*255
	LOGICAL too_long

	submit_chunk = ' '
	submit_beg = 1
	too_long = .false.

	if (submit_lth.gt.132) then
	too_long = .true.
	open(unit=20,file='perp.tmp',access='sequential',status='new',
     &	     recl=300,err=500,dispose='keep')
	write(20,100)
100	format('$ save_ver = f$verify(0)',/,'$ set noon')
	submit_chunk = submit_line(submit_beg:submit_beg+225)
	submit_beg = submit_beg + 225
	icode = str$trim(submit_chunk, submit_chunk, chunk_lth)
C
	if (submit_beg.lt.submit_lth) then
	write(20,150) submit_chunk(1:chunk_lth)
150	format('$ ',A,'-')
	else
	write(20,175) submit_chunk(1:chunk_lth)
175	format('$ ',A)
	endif
C
	do while (submit_beg.lt.submit_lth)
	submit_chunk = submit_line(submit_beg:submit_beg+225)
	submit_beg = submit_beg + 225
	icode = str$trim(submit_chunk, submit_chunk, chunk_lth)
C
	if (submit_beg.lt.submit_lth) then
	write(20,200) submit_chunk(1:chunk_lth)
200	format(A,'-')
	else
	write(20,250) submit_chunk(1:chunk_lth)
250	format(A)
	endif

	enddo

	write(20,300)
300	format('$ delete/nolog/noconfirm perp.tmp;*',/,
     &	       '$ if save_ver then $ set verify')
	close(unit=20)
	endif
	goto 600

500	continue
	type *,'?Error openning temporary file!'
	stop
600	continue

	RETURN
	END
