*
*	Program to do the work of POS using the GETDISKS function
*
	program pos
	implicit integer(a-z)
	character device*20
	character logname*34
	character diskpool*2048

	istat = getdisks(diskpool, context, device, devlen)
	if ( (istat .and. 1) .ne. 1) call lib$signal(%val(istat))

	print 50
d	totblks = 0
d	totfree = 0

10	continue
	  if ( (diskinfo(device, logname, loglen, maxblks, freeblks)
     &		.and. 1) .eq. 1) then
	    if (device(1:1) .eq. '_') then
	      start = 2
	    else
	      start = 1
	    end if
	    logname = logname(:loglen)		! now have trailing spaces
	    print 100, device(start:), logname,
     &		maxblks, freeblks, 100.0 * freeblks / maxblks
d	    totblks = totblks + maxblks
d	    totfree = totfree + freeblks
	  end if
20	  istat = getdisks(diskpool, context, device, devlen)
	if ( (istat .and. 1) .eq. 1) goto 10

d	print 100, ' ', 'Total  ', totblks, totfree, 100.0*totfree/totblks
	
	call exit

50	format('0Device', t21, 'Logical Name', t49, 'Max. Space',
     &		t62, 'Free Space', t76, '% Free')
100	format(1x, a19, a27, i11, i13, f10.2)
	end
