Developing Windows Clients |
Provides access to data sources.
Attributes
Parent Property
Methods
ListLibrefs Method
AssignLibref Method
DeassignLibref Method
UseLibref Method
Exceptions
DataServiceNoLibrary Error
DataServiceNoWorkDeassign Error
DataServiceLibraryInUse Error
DataServiceInvalidEngine Error
This service provides access to tabular data sources within a SAS Workspace. It acts as an access point within the workspace for standard data access APIs such as ADO, OLE DB and JDBC. It also gives you control over data source configuration by providing methods to manage the workspace's librefs. Librefs are references to SAS data libraries. They are often used by SAS language programs to specify SAS datasets.
Parent Workspace property
Type: Workspace
Description
This property allows you to navigate back to the Workspace, which is the parent of this object.
Example
Usage
Lists all the currently defined libraries.
Description
This method returns a list of the names of all the currently defined libraries in the server.
Usage
You can use this method to discover what libraries are assigned in your Workspace. The return value is an array of strings listing the libref names. If you need a Libref object, you can pass any of the returned names to UseLibref.
Parameters
Name | Direction | Type | Description |
---|---|---|---|
names | out | String(index) | An array of strings containing the libref names. |
Errors Returned
Example
See Also
Assigns a libref for the specified path, and returns a pointer to a new object for the libref.
Description
This method uses the specified information to assign a libref in the server. It then returns a Libref object which represents the new libref. This method is equivalent to the LIBNAME statement in the SAS language. You can use the Libref object to access and manipulate the members of the library.
This method is similar to the UseLibref method in that they both return a Libref object. However, it differs in that it creates a new libref while the UseLibref method references an existing libref.
Usage
The name, engine, path, and options parameters adhere to the conventions of the corresponding parts of the LIBNAME statement.
Parameters
Name | Direction | Type | Description |
---|---|---|---|
name | in | String | This parameter is the name of the libref, which acts as a logical name for the data library to which it is assigned. It should conform to the rules of SAS libref names for the platform on which the server is running. |
engine | in | String | This string specifies the name of the engine to use with the newly-created libref. The available engines are dependent on the host system, the version of SAS and the site installation. An empty (zero-length) string indicates the default engine. |
path | in | String | The host filesystem pathname (or other engine-specific designation) of the SAS data library being referenced. The form of the specification is dependent upon the platform on which the server is running and the conventions of the selected engine. The engine will often require that this location (such as a directory) already exist on the server machine. |
options | in | String | This input string contains any LIBNAME and/or engine options that are to be applied to this assignment. If no options are needed, pass an empty (zero-length) string. |
Returns Libref
Errors Returned
Example
See Also
Deassigns an existing libref.
Description
This method deassigns an existing libref. Calling it is equivalent to executing a LIBNAME CLEAR statement in the SAS language.
If files are currently open in the same scope as the assigned libref, RIO will close the files before deassigning the libref. If there are files currently open in a different scope, the deassign will fail.
Usage
Parameters
Name | Direction | Type | Description |
---|---|---|---|
name | in | String | This string parameter specifies the name of the libref to deassign. |
Errors Returned
Example
See Also
Obtains the libref object for the specified libref name.
Description
This method returns a pointer to a Libref object for an existing library. The Libref object is used to access and manipulate the members of the library.
Usage
This method is similar to the AssignLibref method in that they both return a Libref object. However, it differs in that it returns the object for an existing library whereas AssignLibref creates a new libref and returns the object for that.
Parameters
Name | Direction | Type | Description |
---|---|---|---|
name | in | String | This string specifies the name of the existing libref that is to be used. The name must correspond to a libref that has already been assigned in this Workspace. This libref could have been created by the AssignLibref method call, it could have resulted from the execution of a LIBNAME statement or it may be a predefined library such as WORK, SASUSER or SASHELP. |
Returns Libref
Errors Returned
Example
See Also
Description
The specified SAS data library does not exist.
Description
The SAS System library WORK may not be deassigned.
Description
The data service could not clear or deassign a library
because it was in use.
Description
The specified SAS engine was not found. The engine name that
you specified is probably invalid, but it may also be that
the the engine is not available on this host or on this release
of the SAS System.
Developing Windows Clients |