If you wish to delete a dozen or so user IDs, you could just enter the same number of REMOVE commands in your CARLa program, like so:
REMOVE USER=u1
REMOVE USER=u2
and when you run this program, RACF commands are generated. This is what happens when you enter several D line commands or a DD ... DD block in RA.U.
If you need to select user IDs with a selection rule as Jeroen suggested, you need one CARLa step to evaluate the selection and generate (hundreds of) REMOVE commands, and a second step to run these commands to generate the RACF commands. This could be done with a CARLa program under ISPF that writes to CKR2PASS, like so (in case you wanted to delete all users that had not logged on in the last 2 years):
newlist type=racf nopage dd=ckr2pass
select class=user segment=base ljdate<>never ljdate<today-730
sortlist 'REMOVE USER=' | key
Writing to CKR2PASS under ISPF option CO.C automatically displays the generated CARLa commands, where you can type GO in the command line to execute those in turn.
You can do the same in JCL with a job like this. Note, replace the SYS1 prefix with the value(s) your installation used to store CKRPARM and SCKRPROC:
// JCLLIB ORDER=(SYS1.CKRPARM,SYS1.SCKRPROC)
//STEP1 EXEC C2RC
//CKR2PASS DD DISP=(,PASS),DSN=&&CKR2PASS
//SYSIN DD *
newlist type=racf nopage dd=ckr2pass
select class=user segment=base ljdate<>never ljdate<today-730
sortlist 'REMOVE USER=' | key
//STEP2 EXEC C2RC
//SYSIN DD DISP=OLD,DSN=&&CKR2PASS
If you add a CKFREEZE DD to your STEP2, zSecure will use this to find any catalog alias definitions and data sets for the user IDs, and generate IDCAMS DELETE commands to delete these.
Finally, if you have a (sizable) list of user IDs in a sequential data set, you could use these to generate REMOVE commands like this. In STEP1 we must add an ALLOC command for the RACF database, because the ALLOC for the INPUT DD stops automatic allocation of the RACF input source.
// JCLLIB ORDER=(SYS1.CKRPARM,SYS1.SCKRPROC)
//STEP1 EXEC C2RC
//CKR2PASS DD DISP=(,PASS),DSN=&&CKR2PASS
//INPUT DD *
user1
user2
//SYSIN DD *
alloc type=racf active
deftype type=$input
alloc type=$input dd=input
newlist type=$input nopage dd=ckr2pass
define id as word(record,1)
select exists(id:dfltgrp)
sortlist 'REMOVE USER=' | id
newlist type=$input dd=ckreport,
toptitle='User ID does not exist in RACF'
select missing(id:dlftgrp)
sortlist id
//STEP2 EXEC C2RC
//SYSIN DD DISP=OLD,DSN=&&CKR2PASS