C******************************************************************************
	SUBROUTINE AK$DSK_USG(ISTAT)
C******************************************************************************
C AKDSKUSG.FOR
C
C	Written by : M. Serrer     DME/NRC  Systems lab.
C	Date       : Mar/84
C
C	Modified   : Feb/85   M. Serrer    for compatability with VMS V4
C
C------------------------------------------------------------------------------

	INCLUDE 'AK.INC/NOLIST'

	INTEGER*2	GRP,MEM
	INTEGER*4	BLK
	CHARACTER	UIC_STR*18,USER*12
	LOGICAL		DSK_USG_DUM*1

C_Get next record from file 'SYS$SYSTEM:DSKUSG.LIS'

	ISTAT=0
	DO WHILE( ISTAT .NE. EOF )
  10	  CONTINUE

	  READ(DSK_FIL,'(A18,(I))',IOSTAT=ISTAT ) UIC_STR,BLK

	  L1=LIB$LOCC( '[' , UIC_STR )
	  L2=LIB$LOCC( ',' , UIC_STR )
	  L3=LIB$LOCC( ']' , UIC_STR )

C_Decide if UIC's are in the form's  [string] , [#,#]  or  [string,string]

	  IF ( L1 .EQ. 0 .AND. L3 .EQ. 0) THEN	!_Not a line of interest
	    GOTO 10

	  ELSE IF ( L2 .EQ. 0 ) THEN		!_Form is  [name]
	    USER=UIC_STR(L1+1:L3-1)

	  ELSE IF ( UIC_STR(L1+1:L2-1) .EQ. '0' ) THEN
	    USER='SYSTEM'

	  ELSE IF ( UIC_STR(L1+1:L2-1) .EQ. '1' ) THEN
	    USER='SYSTEM'

	  ELSE IF ( UIC_STR(L1+1:L2-1) .EQ. '10' .AND.
     &	            UIC_STR(L2+1:L3-1) .EQ. '40'      ) THEN
	    USER='SYSTEM'

	  ELSE
	    USER=UIC_STR(L2+1:L3-1)

	  END IF

C_Search for Username to be charged

	  U_NUM=0
	  AK$USR_NAM=' '

	  DO WHILE ( U_NUM .LE. TOT_USR .AND. AK$USR_NAM .NE. USER  )
	    U_NUM = U_NUM+1
	    AK$RECORD = AK$SUMMARY(U_NUM)
	  END DO

C_Found it

	  IF ( AK$USR_NAM .EQ. USER ) THEN
	    AK$DSK_BLK = AK$DSK_BLK+BLK
	    AK$SUMMARY(U_NUM) = AK$RECORD

C_Didn't find it

	  ELSE
	    TYPE 210 ,UIC_STR,BLK
 210	    FORMAT('*** INFO, No match for UIC ',(A),
     &	           ' in SYSUAF.DAT, Disk space used =',(I),' blocks')

	  END IF
	END DO

	RETURN
	END
