	program mdatest
	logical is, loc_batch, loc_inter, loc_network
	integer j,k,l,readlen
	character*20 filename, defaultfile, queuename, jobname
	character*20 readbuf
	integer long_array(10)
	integer*2 word_array(10), another_word_array(10), jn
	integer	feb_2001(2)
C
	integer loc_nargs
	external loc_nargs
C(* is it in batch mode *)
	is = loc_batch()
	type *, 'In batch mode :',is
	is = loc_inter()
	type *, 'Interactive   :',is
	is = loc_network()
	type *, 'Network       :',is
	type *

C(* swap byties *)
	  do j=1,10
	  word_array(j) = j
	  end do
	type *,'Ordered lsbyte first'
	type 1,word_array
1	format( 10Z5.4 )
	call loc_bswap( word_array, 10 )
	type *,'Ordered lsbyte last'
	type 1,word_array
	type *

C(* zero arrays *)
	  do j=1,10
	  another_word_array(j) = j*3+1
	  end do
	type *,'Is this array zero'
	type 1,another_word_array
	call loc_zeroarray(another_word_array,10*2)
	type 1,another_word_array
	type *

C(* copy arrays *)
	type *,'copy something into this array'
	type 1,another_word_array
	call loc_copyarray( word_array, another_word_array, 10*2 )
	type 1,another_word_array
	type *

C(* How many arguments passed to main program *)
C	type *,'Arguments passed to me:',loc_nargs(0)
C	type *

C(* open mdatest.for and read it until error *)
	type *,'Try out MDATEST.FOR as a file'
	l = loc_iofast$open(2,'MDATEST','SYS$DISK:[].FOR')
	type 2,l
2	format(' return status of ',Z9 )
	  do while (l)
	  l = loc_iofast$get(2,readbuf,readlen)
	  type *,readbuf(:readlen),readlen
	  type 2,l
	  end do
	l = loc_iofast$close(2)
	type 2,l
	type *	

C(* submit MDATEST.COM for printing in feb 2001 *)
	type *,'print mdatest.com in feb 2001 '
	call SYS$BINTIM( '2-FEB-2001 19:37:00', feb_2001 )
	l = loc_print( 'mdatest.com', 'SYS$PRINT', 'mdatest',
     *  feb_2001, 2, , 3, .true., jn )
	type 2, l
	type *, ' job number ',jn
	type *

C(* submit mdatest.com as a batch job on SYS$MARS after feb 2001 *)
	type *,'submit mdatest.com in feb 2001'
	l = loc_jobsubmit( 'mdatest.com', 'SYS$MARS', 'mdatest',
     *  feb_2001, 'mdatest11.lll', , , jn, ,,,,,,, )
	type 2,l
	type *,' job number ',jn
	type *

	END
