If you want to check that a user is connected to a group, you can use the following two step process.
//* Write users connected to GROUP1 into &&USERS
//LISTGRP EXEC C2RC
//USERS DD DISP=(,PASS),DSN=&&USERS
//SYSIN DD *
alloc type=racf active
newlist type=racf dd=USERS nopage
select class=user cggrpnm=GROUP1
sortlist profile(8)
//*
//LISTDSN EXEC C2RC
//USERS DD DISP=OLD,DSN=&&USERS
//SYSIN DD *
deftype type=$users
alloc type=$users dd=USERS
define type=$users userid(8) as word(record,1)
newlist type=dsn f=ckrcmd
define auser as word(dsn,2,'.')
select dsn=OMVSUSER.**.ZFS not(auser:entype=2 and exists(auser:$users.userid.record))
list 'DELETE' dsn
//*