C     Program EX_0206.FOR
C     Listing 2F - see documentation in TUTOR.SSS
 
$include:'SSSF1.H'
 
      real*8 function rnx(m, s)
$include:'SSSF2.H'
      real*8 m, s, x
  99  x = RN(m, s)
      if (x.lt.0.0) goto 99
      rnx = x
      return
      end

      Program EX_0206
$include:'SSSF2.H'
      real*8  pt, rnx, mean, sd, erm, min, mode, max
      data mean /7.0/, sd /4.0/, erm /2.0/
      data min /1.0/, mode /3.0/ max /4.0/

      pt = rnx(mean, sd)
  99 write (*, '(A, F7.2\)')' start of call is at ', pt
        if (RA().lt.0.25) then
          pt = pt + ER(2, erm)
        else
          pt = pt + TR(min, mode, max)
        endif
        write (*, '(A, F7.2)')' ends at ', pt
        pt = pt + rnx(mean, sd)
      if (pt.lt.120.0) goto 99
      end
 