The dog might have an intestinal obstruction. It could be cancer, or something that was swallowed like a rubber ball. See a veterinarian.