The commas don't optimize the WHERE clause. They probably include them to make the where clause more compatible with external databases just in case the where clause ends up being pushed down into the external database.
Or it just could be that the SAS programmer that wrote the code that generates the WHERE clause that is printed didn't know that SAS supports either spaces or commas as the delimiters in the list of values for the IN operator.
... View more