Since you did not provide a type for b in it's first use [cat(b,'1')], SAS assumed it was numeric. Numeric variables are legitimate arguments to the CAT function. The documentation states that it does not provide an error or warning on conversion.
Catch up on SAS Innovate 2026
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.