Thank you very much. So, apparently it should be possible in principle to perform the t-tests on your data, but PROC TTEST (with the ODS OUTPUT statement) doesn't do it if the input dataset is "too large."
Indeed, I've just created a test dataset with 25 million observations and my SAS 9.4M5 fails to produce output as well and writes the three warnings to the log.
But @STAT_Kathleen's suggestion to turn ODS GRAPHICS off resolves the issue.
Edit: ODS GRAPHICS can also have a disastrous impact on run time (see https://communities.sas.com/t5/SAS-Programming/how-slow-would-the-TTest-procedure-be/m-p/488900/highlight/true#M127508 from 2018 for an example with PROC TTEST), but I was under the impression that your ODS EXCLUDE statement would counteract that effect sufficiently. Good to know that this is not the case. Rick_SAS's macros ODSOff and ODSOn mentioned in that 2018 thread also use both these ODS statements among others in order to improve performance.
Edit 2: As described in later posts of that 2018 thread, with older releases such as SAS 9.4M2 it's even possible that SAS works unnecessarily on certain ODS-related files and thus wastes time and disk space in spite of ods graphics off.
... View more