# "@(#)priamcertify	5.1	6/10/86"
echoln '###############################################'
echoln '#  SUS Script for certifing Priam Disc Drives #'
echoln '#    If number of units to test is one then   #'
echoln '#     the user can specify the number of      #'
echoln '#     times to certify the disc.              #'
echoln '###############################################'
dec
eval u=0
unit u
repeat
echo 'Enter Number of Units to test : '
read y
until (y>0)&&(y<5)
pci
echo 'Enter Number of Pages  on Drive ' u ' : '
read a
echo 'Enter Number of Tracks per Head on Drive ' u ' : '
read b
if y==1
  do
    echo 'Enter Number of times to certify Disc : '
    read n
  done
fi
echoln
repeat
echo 'Making BadBlocks for Drive ' u ' ...'
mbb
echoln
echoln '***Starting Certify of Priam Disc Drive ' u '***'
echoln '     Can be terminated with LoadEn Off      '
eval z=0
if y>1
  repeat
    seek rand>>16%b
    certify z 1
    eval z=z+1
  until (z>=a)||(!lden)
else
  for m=1 (m<=n)&&(lden) m=m+1
    do
     repeat
       seek rand>>16%b
       certify z 1
       eval z=z+1
     until (z>=a)||(!lden)
     echoln '-->End of pass ' m
     eval z=0
    done
fi
if y==1
 wsb suspectblocks
else
 do
  if u==0
    wsb suspectblocks0
  else
    if u==1
      wsb suspectblocks1
    else
      if u==2
        wsb suspectblocks2
      else
        wsb suspectblocks3
      fi
    fi
  fi
 done
fi
if z>=a
  echoln '>>>>  Certify Complete on Drive ' u '  <<<<'
fi
lsp
eval u=u+1
if u<y
  unit u
fi
until (u>=y)||(!lden)
unit 0
echoln 'If Page Count is not Zero then there are new Bad Spots on this Disc'
echoln 'which were not in the BadBlock file,  SuspectBlock file has been'
echoln 'written to floppy.'
