I was asked about W2 printing with masked SS# and this is what I found. I am hoping this saves someone the research.
Based on this article from BNA (tax software) it was codified in 2015 but could not be done for 2015 W-2s filed in 2016.
https://www.bna.com/irs-allow-truncated-n57982066286/ This IRS article with updates in 2016 says it does not apply to W-2s but no cross reference to an article that does apply to W-2s (see last line in this article)
https://www.irs.gov/government-entities/federal-state-local-governments/truncated-taxpayer-identification-numbers
Current IRS instructions state
https://www.irs.gov/pub/irs-pdf/iw2w3.pdf
Social security numbers. Do not truncate social security numbers shown on Forms W-2, W-2AS, W-2GU, and W-2VI. Social security numbers are required on Forms W-2. See Taxpayer identification numbers, later. See also Regulations section 301.6109-(4)(b)(2).
I also read 301.6109-(4)(b)(2) and it appears unless that code section is overwritten you cannot truncate.