I'm thinking to write a book where I could need to use some code samples regarding a proprietary software (SAS in particular). So my question is, should I pay something to the software owner just for using some code rows? Or just because I mention the proprietary software name in my book? I stress that these code samples would be written by me, but usable in a software (as SAS is), that is not open source but is covered by copyright.
That a computer language is proprietary does not mean that all code written in that language is copyrighted by the holder of copyright on the language. Anyone may write, and publish, code in a particular language without permission from the language designers, or anyone else, provided that the code is original and is not a close paraphrase of code written by someone else.
If the code to be published was created by someone else, permission would be needed unless the code falls under fair use or some other exception to copyright. Permission might or might not have to be paid for.