externalstringfunctionspec  derrs(integer  n)
recordformat  oinff(string (11) name,integer  sp12,nkb,
                    byteinteger  arch,codes,cct,ownp,eep,use,codes2,
                    ssbyte,flags,pool,dayno,sp31)
externalintegerfunctionspec  dfilenames(string (6) user,
                                        record (oinff)arrayname  inf,
                                        integername  fileno,maxrec,
                                        nfiles,integer  fsys,type)
externalintegerfunctionspec  get usnames(integername  n,integer  adr,
                                         fsys)
externalroutinespec  get av fsys(integername  n,integerarrayname  a)
systemstringfunctionspec  itos(integer  n)
!
!
integerfunction  stoi(string (255) s)
if  s = "-1" then  result  = -1
if  length(s) = 1 then  s = "0".s
if  length(s) # 2 then  result  = -2
unless  '0' <= charno(s,1) <= '9' then  result  = -2
unless  '0' <= charno(s,2) <= '9' then  result  = -2
result  = (charno(s,1) - '0')*10 + charno(s,2) - '0'
end ;  ! of stoi
!
!
externalroutine  doarch(string (255) s)
string (6)array  u(0:1023)
integer  nu,nusers,fromrec,ngiven,nfiles,flag
integer  j,n,fx,fsys,ix
integerarray  a(0:99)
string (31) file
string (63) user
record (oinff)array  flis(0:255)
!
fsys = -1
if  s # "" then  start 
   fsys = stoi(s)
   unless  -1 <= fsys <= 99 then  -> bp
finish 
if  fsys<0 then  get av fsys(n,a) else  a(0) = fsys and  n = 1
fx = 0
while  fx<n cycle 
   fsys = a(fx)
   printstring("+++ FSYS ".itos(fsys)." +++"); newline; newline
   j = get usnames(nusers,addr(u(0)),fsys)
   printstring("GET USNAMES flag ="); write(j,1)
   printstring("  No of users ="); write(nusers,1); newlines(2)
   nu = 0
   while  nu<nusers cycle 
      user<-u(nu)
      if  length(user) = 6 then  start 
         fromrec = 0
         ngiven = (1<<31)!256
         flag = dfilenames(user,flis,fromrec,ngiven,nfiles,fsys,0)
         if  flag # 0 then  start 
            printstring("User ".user." DFILENAMES flag =".derrs(flag))
             newline
             nu = nu + 1
            continue 
         finish 
         ix = 0
         while  ix < ngiven cycle 
            file = flis(ix)_name
            if  file = "#ARCH" or  file = "SS#DIR" or  file = "SS#OPT" or  file = "SS#PROFILE" then  start 
               ix = ix + 1
               continue 
            finish 
            if  flis(ix)_codes&128 # 0 then  start 
               printstring(user.".".file); newline
            finish 
            ix = ix + 1
         repeat 
      finish 
      nu = nu+1
   repeat 
   fx = fx + 1
repeat 
return 
bp:
printstring("Illegal fsys specification"); newline
end ;  ! of doarch
endoffile