Hello,
Yours is an interesting question. This is a topic that is addressed in seminars because it points out that although you are using the best software for piping stress analysis, you also MUST have an understanding of the Code and of basic Piping system design.
"Code stresses" are those that are specifically addressed by the Code. The B31 Pressure Piping Codes address the BENDING stresses (and torsional stresses) due to thermal expansion/contraction and they also address the longitudinal BENDING stress (due to weight) added to the longitudinal pressure stress (the sum of these stresses is called the "sustained stresses" or the "additive stresses").
As you point out, If a designer were to analyze a system that had a straight piece of pipe between two rigid anchors, the Code equations would not address the resulting stress in the pipe because it is not a bending stress - it is a compressive buckling stress. The Code is not intended to be a design "handbook", it is assumed that the designer understands piping systems and that he/she will not place a straight piece of pipe between two anchors.
Many years ago, the Codes had an equation that was intended to address pure longitudinal compression and tension in pipe (this would be addressed together with sustained stresses). The equation calculated the stress as the compressive or tensile FORCE divided by the AREA of metal in the pipe wall: Stress (psi) = F (in pounds) / A (in square inches). However, it was recognized that the compressive force could easily buckle a long slender structural member (before it would approach the strength of the material) and there was no rule in the Code to account for the "slenderness ratio" of the pipe. So the equation was dropped - it was assumed that engineers knew better.
So, as you have discovered, piping systems are more complex than might be assumed by a inexperienced (in piping design) engineer. May I suggest to you that you look into a piping design seminar and that you consider obtaining the EXCELLENT books by Woods and Baguley and by Dr. Chuck Becht - go here:
http://www.asme.org/pubs/ and go here:
http://www.normas.com/CASTI/B31.3.html. Please do not think I am "picking on" you. You asked a good question and I hope you will continue to ask questions as you gain experience. Good luck with your projects.
Best regards, John.