SAS 9.1.3 Integration Technologies » Developer's Guide


LDAP SCL Interface
_ADD
_CLOSE
_DELETE
_MODIFY
_OPEN
_SETOPTIONS
_SEARCH
Directory Services

_SETOPTIONS

Sets options on an open LDAP server session.

Syntax

_SETOPTIONS(timeLimit, sizeLimit, base, referral, restart, property, propertyValue);

timeLimit
Numeric, input.
Specifies the maximum number of seconds that the client is willing to wait for a response to a search request. A value of 0 indicates no time limit. The time limit is set to 0 by default. The default value is in effect until it is changed. A value of -1 indicates that the existing value is to remain unchanged.

sizeLimit
Numeric, input.
Specifies the maximum number of entries to return in a search result. A value of 0 indicates no size limit. The size limit is set to 0 by default. The default value remains in effect until it is changed. A value of -1 indicates that the existing value is to remain unchanged.

base
Character, input.
Specifies the base object for the search operation, which must be a distinguished name. An initial base object was specified when the connection to the LDAP server was established. Specifying a non-blank value for the base parameter overrides the existing base object definition. Specifying a blank value retains the existing value.

referral
Character, input.
Indicates whether or not to chase referrals, by setting either the OPT_REFERRALS_ON option or the OPT_REFERRALS_OFF option. One or the other of these options was specified when the connection to the LDAP server was established. Specifying either option as the value of the referral parameter overrides the existing value. Specifying a blank value retains the existing value.

restart
Character, input.
Indicates whether or not to restart a query if EINTR occurs. At _open time, the default session settings are determined. _setOptions can be used to change these defaults. Valid values for restart are OPT_RESTART_ON or OPT_RESTART_OFF. A blank value can be passed in to indicate that the default value of OPT_RESTART_OFF should be used.

property
Character, input.
Specifies the name of an optional property that is being set. Currently, the only property that is supported is the SEARCH_SCOPE property which specifies the scope of searches in the LDAP directory. Specify the value of the property using the propertyValue parameter.

propertyValue
Character, input.
Specifies the value for the property parameter. Valid values for the SEARCH_SCOPE property are as follows:

SUBTREE_SEARCH_SCOPE
Sets the scope of the search to include all subtrees. This is the default.

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 overrides the default value of SUBTREE_SEARCH_SCOPE.

Details

When invoked on an LDAPSERVICES instance, the _SETOPTIONS method configures an LDAP session by changing session options. Once changed, these values remain in effect until they are overridden by a subsequent call.

Examples

The following example sets various session options.

timelimit=120;
sizelimit=100;
base='';  /* use default set at _open time */
referral = "OPT_REFERRALS_OFF";
restart = "";    /* use default */
rc = ds._SETOPTIONS(timelimit, sizelimit, base, referral, restart);

The following example uses the optional properties parameter to set the search scope.


timelimit = -1;  /* use current setting */
sizelimit = -1;  /* use current setting */
base='';         /* use default set at _open time */
referral = "";   /* use default set at _open time */
restart = "";    /* use default */
prop = "SEARCH_SCOPE";
propValue = "BASE_SEARCH_SCOPE"; /* only search the base */
rc = ds._setOptions(timelimit, sizelimit, base, referral, restart, prop, propValue);