cat > script.ff <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
	subroutine mfmain
	include	'INCLUDE/msf.h'

	character	name*12, amount*12

	call mfopen (
     &  'DATABASE'
     &  , 'loans', 'r')
	print 10
10	format (1x, 'Current Loans Outstanding' //1x, 
     &		'Name         Amount')

	call mfsrtb ('s', 'loans', char(0),
     &		'name', 'a', 'amount', 'd', char(0))

20	if (mfget () .ne. 1) goto 40
		junk = mfgetv (name, 12, 'name')
		junk = mfgetv (amount, 12, 'amount')
		print 30, name, amount
30		format (1x, a12, a12)
		goto 20
40	call mfgete

	call mfclos ('loans')
	end
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 script.ff
cat > stdout <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
Current Loans Outstanding

Name         Amount
Jones       $300.00     
Jones       $33.95      
Jones       $25.00      
Kilroy      $250.00     
Mosca       $200.00     
Mosca       $150.00     
Peterson    $50.00      
Wladislaw   $75.00      
Wladislaw   $55.00      
Wladislaw   $25.00      
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 stdout
cat > tag <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
Sorted retrieval
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 tag
