C******************************************************************************
	SUBROUTINE AK$SYS_UAF(ISTAT)
C******************************************************************************
C AKSYSUAF.FOR
C
C	Written by : M. Serrer  NRC/DME  Systems Lab.
C	Date       : Mar/84
C	Modified   : Feb/85   M. Serrer  for VMS Version 4
C	Modified   : Jun/86   K. Trumbley  TOT_USR calculated wrong
C
C	  This routine gets the USERNAME, UIC and ACCOUNT
C	the file SYSUAF.LIS
C
C------------------------------------------------------------------------------

	INCLUDE 'AK.INC/NOLIST'
	LOGICAL		JUNK*1
	CHARACTER	UIC_DUMMY*13

	AK$RECORD=AK$SUMMARY(1)
	AK$USR_NAM='<login>'
	AK$USR_GRP=0
	AK$USR_MEM=0
	AK$USR_ACC='UNKNOWN'
	AK$SUMMARY(1)=AK$RECORD

C_Ignore first record of file

	READ(UAF_FIL,'(A1)',IOSTAT=ISTAT) JUNK

	TOT_USR=1

C_Read until end of file found

	DO WHILE (ISTAT .NE. EOF )

	  TOT_USR=TOT_USR+1
	  AK$RECORD=AK$SUMMARY(TOT_USR)

	  READ(UAF_FIL,201,IOSTAT=ISTAT ) AK$USR_NAM,UIC_DUMMY,AK$USR_ACC
 201	  FORMAT(21X,A12,T36,A13,T51,A8)

C_Parse UIC group and member integers from string UIC_DUMMY

	  L1=LIB$LOCC( '[' , UIC_DUMMY )
	  L2=LIB$LOCC( ',' , UIC_DUMMY )
	  L3=LIB$LOCC( ']' , UIC_DUMMY )
	  READ( UIC_DUMMY(L1+1:L2-1) , '(I)' ) AK$USR_GRP
	  READ( UIC_DUMMY(L2+1:L3-1) , '(I)' ) AK$USR_MEM

C_Map user record into array

	  AK$SUMMARY(TOT_USR)=AK$RECORD

	END DO

	TOT_USR=TOT_USR-1

	RETURN
	END
