0
is
specified, then the standard port of 389 is used.
""
is specified and the LDAP_BINDDN variable has not been set, then an unauthorized bind is performed.
""
is specified and the LDAP_BINDPW variable has not been set, then an unauthenticated bind is performed.
Passwords that have been encoded by using the PWENCODE procedure can
be used to bind to the server. For more
information, see the PWENCODE procedure.OPT_REFERRALS_OFF | instructs the server to not chase referrals. Specifying this option overrides the default value of OPT_REFERRALS_ON. |
SUBTREE_SEARCH_SCOPE | sets the scope of the search to include all subtrees. This is the default value. |
BASE_SEARCH_SCOPE | sets the scope of the search to include only the base. This value overrides the default value of SUBTREE_SEARCH_SCOPE. |
ONELEVEL_SEARCH_SCOPE | sets the scope of the search to include the base and one additional level. This value overrides the default value of SUBTREE_SEARCH_SCOPE. |
_SELDBOS | indicates that the specified bind distinguished name is outside the scope of the directory server. |
_SELDNSO | indicates that the bind DN does not exist. |
_SELDICR | indicates that an invalid password was specified. |
_SELDDWN | indicates that the SAS system was unable to connect to the LDAP server. |
dclass = loadclass('sashelp.base.ldapservices.class'); ds = instance(dclass); server = "myhost.net.com"; base = "Alphalite Airways,c=US"; bindDn=""; pw=""; rc = ds._open(server,8001,base,bindDn,pw); if rc ne 0 then do; if (rc = %sysrc(_SELDBOS)) then put 'Bind outside of scope.'; else if (rc = %sysrc(_SELDNSO)) then put 'No such object.'; else if (rc = %sysrc(_SELDICR)) then put 'Invalid credentials.'; else if (rc = %sysrc(_SELDDWN)) then put 'Unable to contact LDAP server.'; else do; msg = sysmsg(); put msg; end; end;
server = "myhost.net.com"; base = "Alphalite Airways,c=US"; bindDN ="cn=John Doe,ou=People,o=Alphalite Airways,c=us"; pw="myPass1"; referral= "OPT_REFERRALS_OFF"; rc = ds._OPEN(server,8001,base,bindDn,pw,referral);