A REXX BATCH which runs the command:
TSS LIST(ACIDS) TYPE(USER) DATA(NAMES) and ends up with an S66D abend and with the following message:
*TSS9999E CA-TSS SECURITY SVC ABEND S66D IN TSSRSVCS+F13C
If the list only selects a department, the batch runs properly.
The dump shows an S66D-40 abend, it occurred when TSS was dealing with security SVC, it's why it intercepted this abend.
It occurred because you issue:
TSS LIS(ACIDS) TYPE(USER) DATA(NAMES)
and there was not enough storage to satisfy the request in REXX storage pool.
Change your TSO/E PROFILE setting to PROFILE VARSTORAGE(HIGH) or in BATCH do:
//SYSTSIN DD *