Generally, your dog will yelp when he poops because there is some type of disorder of the rectum or colon. ... The prostate gland is located under a segment of the colon and an enlarged prostate gland can cause your dog to experience pain when they poop.