Retirement tax questions

Hi,  does that same PA Basis information apply to 1099Rs that have Distribution Code 2 ?  My understanding of Code 2 is that it is some type of early distribution exception.  Do we still need to find all of the Contribution amounts minus other distributions?  Thanks