%begin;      !disc recovery program
   %integer owner, file1, file2
   %recordformat parmfm(%short dsno, dact, ssno, sact,
                        %integer p1,p2,p3,p4,p5,p6)
   %record(parmfm) p
   %integer this unit = 0
   %integer max block = 32000
   %recordformat filefm(%integer name1, name2, %short spine, day)
   %recordformat dirfm(%short files, %byte access, check, %short chain,
                       %byte spare, daccess,
                       %record(filefm)%array file(1:42))

   %recordformat blockfm(%short size, addr)

   %recordformat spinefm(%short last, %byte access, check,
                         %integer size,
                         %record(blockfm)%array b(1:126))

   %record(dirfm) dir
   %record(filefm)%name f
   %integer j,n
   %string(15) username
   %routine write block(%record(*)%Name block)
      %record(parmfm) p
      p_sact = 1
      p_p1 = 301
      p_p2 = addr(block)
      p_p3 = this unit
      p_p4 = 0
      svc(102, p)
      %if p_p1 # 0 %start
         printstring("Cannot write block")
         write(p_p1, 6)
         newline
         %signal 13,0
      %finish
   %end
   %routine pack(%string(15) file)
      %record(parmfm) p
      string(addr(p_sact)) = file
      svc(17, p)
      owner = p_p2;  file1 = p_p3;  file2 = p_p4
   %end
   prompt("Unit: ");  read(this unit)

   dir = 0
   %for j = 1,1,42 %cycle
      prompt("User name: ");  read(username)
      %exit %if username = "."
      prompt("Directory block: ");  read(n)
      pack(username.":PASS")
      f == dir_file(j)
      f_name1 = owner;  f_name2 = file2;  f_spine = n;  f_day = b'01000000'
   %repeat
   write block(dir)
%endofprogram
