The ISASDataSetInfo interface provides a way to return data set metadata that does not directly map to OLE DB constructs. There are two methods:
Method | Description |
---|---|
GetDataSetInfo | Returns file metadata that is specific to SAS. |
GetRecordCounts | Returns information about the number of records that are associated with a file. |
The GetDataSetInfo method 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.
Under some circumstances, the actual values for the lLogicalRecordCount and lPhysicalRecordCount members of the SASDATASETINFO structure will not be immediately available. This is the case when the underlying data set is something other than a physical SAS data file (for example, a SAS data view, a WHERE clause, or a SAS/ACCESS file). In those cases, the members return a -1. To determine the actual values, call ISASDataSetInfo::GetRecordCounts.
The GetDataSetInfo method 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 (members) of the SASDATASETINFO structure are described in the following table:
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, a value of -1 is returned in this field. This is the case when the data set is not a physical file (for example, a SAS data view or a WHERE clause). In such cases, you can use the GetRecordCounts method to computationally determine this value. |
lPhysicalRecordCount | The number of physical records in the data set. This number can be greater than the number of logical records and can indicate the magnitude of the physical file size. If this value is not immediately available, a value of -1 is returned in this field; this is the case when the data set is not a physical SAS file (for example, a SAS data view or a SAS/ACCESS table). In such cases, you can use the GetRecordCounts method to computationally determine this value. |
lRecordLength | The physical record length in bytes. |
dDateCreated | The date that the data set was created. |
dDateModified | The date that 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. |
The GetRecordCounts method forces a count of the number of logical and physical records in a data set. Call this method only when GetDataSetInfo returns -1 in the SASDATASETINFO lLogicalRecordCount and lPhysicalRecordCount fields.
HRESULT GetRecordCounts( LONG * plLogicalRecordCount, LONG * plPhysicalRecordCount );
This method determines record counts by forcing a sequential read of the data set. If the underlying data set is large, the read can take a significant amount of time.
CAUTION:
Some data sets contain millions of records. Executing this method on a very large data set may incur a significant performance cost.
About Custom Interfaces
ISASDatasetInfo90 Custom Interface
ISASColumnsInfo Custom Interface