The following example shows how to delete a user-defined role using the DeleteRole() method:
VAR DataAdminService oDAS. VAR IRole oRole.
VAR LOGICAL lResult.

ASSIGN oDAS = NEW DataAdminService(LDBNAME("DICTDB")).

oRole = oDAS:GetRole("TestRole"). 
lResult = oDAS:DeleteRole(oRole).

DELETE OBJECT oDAS.
Note: In this example, if a role has been granted to a user, an error message appears indicating that the role cannot be deleted. You must first disassociate the role from the users by deleting the granted role records. For more information, see Delete granted role using OpenEdge.DataAdmin.*.