if ($p.p_a == as)
{
  p.v = x
}
elif ($p.p_a == ap)
{
  p.v += s
}
elif ($p.p_a == pr)
{
  p.v =+ p
}

print "p     :" $p.v

d/
{
  file{t}:

  if ($p.p_d_a == as)
  {
    p.v = x
  }
  elif ($p.p_d_a == ap)
  {
    p.v += s
  }
  elif ($p.p_d_a == pr)
  {
    p.v =+ p
  }

  print "p/d   :" $p.v

  if ($p.p_d_t_a == as)
  {
    file{t}: p.v = x
  }
  elif ($p.p_d_t_a == ap)
  {
    file{t}: p.v += s
  }
  elif ($p.p_d_t_a == pr)
  {
    file{t}: p.v =+ p
  }

  print "p/d/t :" $(file{t}: p.v)
}

./: