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.
The 2025 SAS Hackathon has begun!
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.