|
Directory Services
LDAPS_ATTRNAMEReturns the name and the number of values of an attribute in an LDAP entry. SyntaxCALL LDAPS_ATTRNAME(sHandle, entryIndex, attributeIndex, attributeName, numValues, rc);
ExampleThe 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;
|