If you know the layout of the name field in the user profiles, you can optimize the SELECT command. For example, if the first name is always at the beginning of the name field, you could write
select name=JO*
to match JOE BLACK, JONATHAN SEAGULL etc, without falling foul of Scarlett Johansson.
You can combine this with the substring match that Jeroen proposed:
select class=user name=JO* name=:TUPAS
It would be easy to write a CARLa that reads your HRNAMES input file, and generates the required CARLa:
// EXEC C2RC
//CKR2PASS DD DISP=(,PASS),DSN=&PASS
//HRNAMES DD *
JOE BLACK
JOHN TUPAS
//SYSIN DD *
deftype type=$hrnames
alloc type=$hrnames dd=hrnames
newlist type=$hrnames dd=ckr2pass nopage
define first(char) as word(record,1)
define last(char) as word(record,2)
define once(nd) boolean where true
define each(nd) count
summary once,
"newlist type=racf empty='nothing to delete' ",
/ "select class=user (key=SYS1,"
summary each,
"or (name=" | first(0) | "* name=:" | last(0) | "),"
summary once,
")",
/ "sortlist key(8,'user id') name ljdate"
// EXEC C2RC
//SYSIN DD DISP=(OLD,PASS),DSN=&PASS
Things get a little hairier when the HRNAMES data has more than 2 words in the name, like middle initials.
------------------------------
Rob van Hoboken
------------------------------