_MODIFY

Modifies an LDAP directory entry

Syntax

_MODIFY(entryName, attrs);

Required Arguments

entryName
names the directory entry that is to be modified.
Type:Character, Input
attrs
specifies the modify type, attributes, and values that are to be modified in the LDAP directory entry.
Type:SCL list, Input

Details

When invoked on an LDAPSERVICES instance, the _MODIFY method modifies the attributes and attribute values in an LDAP directory entry.
The attrs parameter specifies the attributes and the values in each attribute that are to be modified. The format of the attrs parameter is a list of lists. Each list contains the modification type, attribute name, and attribute values, if any. The lists must have the following format:
List Format
Item Number
Value
1
Character value that represents the type of modification, which can be ADD, DELETE, or REPLACE.
2
Character value that represents an attribute name.
3
Numeric or character attribute value.
n
Numeric or character attribute value.
If the type of modification is DELETE and if no attribute values are specified, then the entire attribute and all values are deleted. If DELETE is specified with one or more attribute values, then only the specified values are deleted.
If the type of modification is REPLACE, then the existing attribute is deleted and is replaced with the specified attribute and attribute values. You must specify all attribute values, because all of the existing attribute values are replaced with the attribute values specified with this method.

Example

The following example modifies three attributes in an LDAP directory entry.
dn = "cn=srvr01.unx.com,o=Alphalite Airways,c=US";
entry = makelist();
alist1 = makelist();
rc = insertc(alist1, "ADD", -1); /* modify type */
rc = insertc(alist1, "sasFrequency", -1); /* attribute name */
rc = insertc(alist1, "monthly", -1); /* attribute value */
rc = insertc(alist1, "weekly", -1); /* attribute value */

alist2 = makelist();
rc = insertc(alist2, "DELETE", -1); /* modify type */
rc = insertc(alist2, "sasNameValueFilter", -1); /* attribute name */

alist3 = makelist();
rc = insertc(alist3, "REPLACE", -1); /* modify type */
rc = insertc(alist3, "sasDeliveryTransport", -1); /* attribute name */
rc = insertc(alist3, "email", -1);

rc = insertl(entry, alist1, -1);
rc = insertl(entry, alist2, -1);
rc = insertl(entry, alist3, -1);

rc = ds._MODIFY(dn,entry);

rc = dellist(alist1);
rc = dellist(alist2);
rc = dellist(alist3);