Contents LDAP Interface Previous Next

LDAPS_ENTRY

Retrieves information about a specific entry returned in a search.

Syntax

CALL LDAPS_ENTRY(sHandle, entryIndex, entryName, numAttributes, rc);

sHandle
Numeric, input.
Specifies the search handle returned by the LDAPS_SEARCH CALL routine. The search handle identifies the entry list returned in the search.

entryIndex
Numeric, input.
Index into the entry list returned by the search. This index is 1-based.

entryName
Character, output.
Returns the name of the entry.

numAttributes
Numeric, output.
Returns the total number of attributes for the specified entry.

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

Example

The following example prints to the SAS log the names and values of all attributes in all entries in a given LDAP directory.

call ldaps_search(lhandle, sHandle, filter, attribs, numEntries, rc);
do entryIndex = 1 to numEntries;

  numAttributes = 0;
  entryName='';

  /* retrieve entry indexed by integer entryIndex */
  call LDAPS_ENTRY(sHandle, entryIndex, entryName, numAttributes, rc);
  put 'Entry name is ' entryName;
  put 'Number of attributes returned is ' numAttributes;

  do attrIndex = 1 to numAttributes;
     call ldaps_attrname(sHandle, entryIndex, attrIndex, attribName,
                             numValues, rc);
     put 'Attribute name is ' attribName;
     put 'Number of values for this attribute is ' numValues;

     do attrValueIndex = 1 to numValues;
       call ldaps_attrvalue(sHandle, entryIndex, attrindex, attrValueIndex,
                                value, rc);
       put "Attribute value is " value;
     end;
  end;
end;

Contents LDAP Interface Previous Next