LDAP Group query

I need to write LDAP group query where I need to find if a particular user is a member of a 2 specific Groups. This is LDAP Novell edirectory implementation.

Below are the details -

LDIF entry for OndotAPI group
dn: cn=OndotAPI,ou=Groups,o=CNS
changetype: add
objectClass: top
objectClass: groupOfNames
objectClass: CCGroupApplication
cn: OndotAPI

# OndotAPI, Groups, CNS
dn: cn=OndotAPI,ou=Groups,o=CNS
member: cn=OndotUsr,ou=WebServices,o=fiserveft
member: uid=test1113,ou=People,o=CNS
member: uid=rtest901,ou=People,o=CNS
member: cn=OndotUsr2,ou=WebServices,o=fiserveft

AND

LDIF entry for CREATE_SESSION role. Notice the user OndotUsr is also a member of that role.
dn: cn=CREATE_SESSION,ou=Groups,o=CNS
changetype: add
objectClass: top
objectClass: groupOfNames
objectClass: CCGroupRole
cn: CREATE_SESSION

# CREATE_SESSION, Groups, CNS
dn: cn=CREATE_SESSION,ou=Groups,o=CNS
member: cn=OndotUsr,ou=WebServices,o=fiserveft
member: uid=test1113,ou=People,o=CNS
member: uid=rtest901,ou=People,o=CNS
member: cn=OndotUsr2,ou=WebServices,o=fiserveft

So I need to verify using LDAP query that OndotUsr is a member of both the group - OndotAPI and CREATE_SESSION.

If this sounds difficult, then i need to write two queries one after the another in my program.
1) 1st query to see if OndotUsr is member of OndotAPI
2) if Yes, then only it'll run second query.
2n query to find if the OndotUsr is member of CREATE_SESSION group.

Need your help in writing this query.

Thank you.