SAS 9.1.3 Integration Technologies » Developer's Guide


LDAP CALL Routine Interface
LDAPS_ADD
LDAPS_ATTRNAME
LDAPS_ATTRVALUE
LDAPS_CLOSE
LDAPS_DELETE
LDAPS_ENTRY
LDAPS_FREE
LDAPS_MODIFY
LDAPS_OPEN
LDAPS_SETOPTIONS
LDAPS_SEARCH
Coding Examples
Adding a Directory Entry to an LDAP Server
Searching an LDAP Directory
Directory Services

LDAPS_ADD

Adds new entries to an LDAP directory.

Syntax

CALL LDAPS_ADD(lHandle, entryName, rc, attr, numValues, attrVal1, ...attrValN, <attr, numValues, attrVal1, ...attrValN>);

lHandle
Numeric, input.
Identifies the connection handle returned by a successful LDAPS_OPEN call. The connection handle identifies the open connection to use when adding entries.

entryname
Character, input.
Names the directory entry to be created.

rc
Numeric, output.
Receives a numeric code that indicates success or failure.

attr
Character, input.
Names an attribute for this particular entry.

numValues
Numeric, input.
Specifies the number of values associated with the attr parameter.

attrVal1, ... attrValN
Numeric or character, input.
Specifies one or more attribute values. The number of values is determined by the numValues parameter.

Details

One or more attributes may be specified. Each attribute name must be followed by the number of attribute values, then followed by a comma separated list of one or more attribute values.

Example

The following example adds two single-value entries to a distinguished name.

dn = "cn=alpair02.unx.com,o=Alphalite Airways,c=US";

attrName = "objectclass";
objValue = "SASDomain";

attrName2 = "node";
nodeValue = "oak.unx.com";

CALL LDAPS_ADD(lHandle, dn, rc, attrName, 1, objValue, attrName2, 1, nodeValue);

The following example adds three attributes, one with multiple values.

dn="sasSubscriberCn=JohnSmith,cn=sassubscribers,
sasComponent=sasPublishSubscribe,cn=SAS,o=Alphalite Airways,c=US";

attrName = "objectclass";
objValue = "sassubscriber";

attrName2 = "sasEntryInclusionFilter";
val = "gif";
val2 = "dataset";
htmlvalue = "html";

attrnName3 = "sasPersonDN";
val3 = "uid=JSmith,ou=people,o=Alphalite Airways,c=us";

CALL LDAPS_ADD(lHandle, dn, rc, attrName, 1, objValue,
attrName2, 3, val, val2, htmlvalue, attrName3, 1, val3);