%EXTERNALROUTINE MYUSERS(%STRING(255)S) %externalroutinespec printchs(%string(255)s) %externalstring(31)%fnspec vdus(%integer i) !%externalintegerfnspec fecount(%integername a, b) %EXTERNALINTEGERFNSPEC DPROCEDURE(%INTEGER ACT, ADR) %RECORDFORMAT RF1(%INTEGER N, A) %RECORD(RF1) R1 %RECORDFORMAT PF(%STRING(6)USER, %STRING(15)TCP, %BYTEINTEGER A, INVOC, B, N, F, %INTEGER LOGS, %BYTEINTEGER site, reason, cons1, cons2, %c %INTEGER ID, PROC, G, H, Z) %RECORD(PF)%ARRAY P(1:256) %record (pf) %name pp %INTEGER J, feusers,tcpusers, i, k, f, l, max %integerarray fe(0:4) %ownintegerarray index(0:255) %string (24) t,u %string(12)%array nam(1:50) %ownintegerarray nuf(1:50) %ownintegerarray nus(1:50) feusers=0;tcpusers=0 %routine sort(%integer n) %integer flag, i, j, k %record (pf) %name s, t %cycle i = n-1, -1, 1 flag = 0 %cycle j = 1, 1, i s==p(index(j)); t == p(index(j+1)) !%if s_user> t_user %start %if s_tcp > t_tcp %start k = index(j); index(j)=index(j+1); index(j+1)=k; flag=1 %finish %repeat %exit %if flag = 0 %repeat %end printchs(vdus(1)) index(i)=i %for i=0, 1, 255 ! j = fecount(feusers, tcpusers) ! %if j # 0 %start ! printstring("feuser count failed ! !") ! %stop ! %finish feusers=0;tcpusers=0 R1_A = ADDR(P(1)) J = DPROCEDURE(1, ADDR(R1)) %IF J = 0 %START max = r1_n printstring("Users ="); write(max-3, 1) newline k = 0 %if s = "TCP" %start nam(i) = "" %for i = 1, 1, 50 k = 1 %cycle i = 1, 1, max pp == p(i) t = pp_tcp %cycle j = 1, 1, k %if t = nam(j) %then %exit %repeat nus(j) = nus(j)+1 %if j = k %start nam(j) = t; nuf(j) = pp_id>>16 &255 k = k+1 %finish %repeat j = 0 %cycle l = 0, 1, 4 %cycle i = 1, 1, k-1 %if nuf(i) = l %start printstring(nam(i)); spaces(14-length(nam(i))) printstring("Fe"); printsymbol(nuf(i)+'0') write(nus(I), 3) j = j+1 %if j = 3 %then newline %and j = 0 %else spaces(5) %finish %repeat %repeat %return %finish sort(max) %cycle i = 1, 1, max pp == p(index(i)) %if pp_reason = 2 %and i > 3 %start %cycle l = 1, 1, 4 charno(pp_user, l) = charno(pp_user, l) +'a'-'A' %if 'A'<=charno(pp_user,l)<='Z' %then charno(pp_user,l)=charno(pp_user,l)%c -'A'+'a' %repeat %finish printstring(pp_user); space; printstring(pp_tcp) %if length(pp_tcp)>6 %start k = k+1 %if k < 3 %then spaces(15) %finish %else %start spaces(6-length(pp_tcp)) %if '0'<= pp_cons1 <= '9' %start printsymbol('+'); printsymbol(pp_cons1); printsymbol(pp_cons2) %finish %else spaces(3) %finish k = k+1; %if k >= 4 %then newline %and k = 0 %else spaces(2) %repeat newlines(2) %cycle i = 0, 1, 4; fe(i) = 0; %repeat %cycle i = 1, 1, r1_n f = (p(i)_id>>16)&255 fe(f) = fe(f)+1 %unless p(i)_tcp = "null" %repeat %cycle i = 0, 1, 4 %if fe(i) # 0 %start printstring("Fep"); write(i, 1); write(fe(i), 3); newline %finish %repeat printstring(", No of fep users =") write(feusers, 1) printstring(", No of TCP users =") write(tcpusers, 1); newline %FINISH %ELSE %START PRINTSTRING("FLAG") WRITE(J, 1) %FINISH %END %end %of %file