SAS IOM Data Provider |
The ISASDataSetInfo interface surfaces data set metadata that does not directly map to OLE DB constructs.
Method | Description |
GetDataSetInfo | Returns SAS specific file metadata. |
GetRecordCounts | Returns information about the number of records that are associated with a file. |
Returns SAS file metadata that is not supported by predefined OLE DB constructs.
HRESULT GetDataSetInfo( SASDATASETINFO ** ppDataSetInfo, OLECHAR ** ppStringsBuffer );
This method makes no logical change to the state of the object.
The lLogicalRecordCount and lPhysicalRecordCount members of the SASDATASETINFO structure returned may be -1. This indicates that the actual values for these members is not immediately available. Such is the case when the underlying data set is something other than a phsyical SAS data file (for example, a view, a WHERE clause, a SAS/Access file, and so on). In these instances, you can determine these values by calling ISASDataSetInfo's other method, GetRecordCounts.
GetDataSetInfo returns file metadata in a SASDATASETINFO structure.
typedef struct tagSASDATASETINFO { LONG lLogicalRecordCount; LONG lPhysicalRecordCount; LONG lRecordLength; DATE dDateCreated; DATE dDateModified; LPOLESTR pwszLabel; LPOLESTR pwszCompressionRoutine; BOOL fIsIndexed; } SASDATASETINFO;
The elements of this structure are used as follows:
Element | Description |
lLogicalRecordCount | The number of logical records in the data set. This is the number of records that are returned if the caller sequentially reads through the entire data set. If this value is not immediately available, -1 is returned in this field; such is the case when the data set is not a physical file (for example, a view or a WHERE clause is set). In such cases, GetRecordCounts can be used to computationally determine this value. |
lPhysicalRecordCount | The number of physical records in the data set. This can be greater than the number of logical records. This value can indicate the magnitude of the physical file size. If this value is not immediately available, -1 is returned in this field; such is the case when the data set is not a physical SAS file (for example, a view or a SAS Access table). In such cases, GetRecordCounts can be used to computationally determine this value. |
lRecordLength | The physical record length in bytes. |
dDateCreated | The date the data set was created. |
dDateModified | The date the data set was last modified. |
pwszLabel | The data set label. NULL if none is set. |
pwszCompressionRoutine | The name of the compression algorithm used. NO if none is set. |
fIsIndexed | TRUE if an index exists on the data set. |
Forces a count of the number of logical and physical records on a data set. This should only be called when GetDataSetInfo returns -1 in the SASDATASETINFO lLogicalRecordCount and lPhysicalRecordCount fields.
HRESULT GetRecordCounts( LONG * plLogicalRecordCount, LONG * plPhysicalRecordCount );
This method forces a sequential read of the data set in order to determine the record counts. If the underlying data set is large, this can take some time. The consumer should not call this method indiscriminately. Some data sets contain literally millions of records, and executing this method on such a data set can incur a significant performance cost.
SAS IOM Data Provider |