Transferring data to SAS
You can transfer data to a SAS data file in the SAS version 7 for Windows, standard-extension format. These types of files have a .
sas7bdat extension. The SAS DSC also writes a SAS program (.
sas) file immediately after writing the SAS data file. For more information, see
SAS DSC.
Writing to a new file
If the SAS data file you specify in the
OutputDataSource section does not exist, the SAS DSC will create a new file.
Writing to an existing file
The SAS DSC cannot append data to an existing SAS data (.sas7bdat) file. The transfer will fail if a file exists with the same name and location as the SAS data file to be written.
Note The SAS DSC always overwrites an existing SAS program (.sas) file that has the same name as the SAS program file to be written.
How do I specify an export to a SAS file?
In the connection string in the
OutputDataSource section, specify
mrSasDsc for the
Data Source connection property. Then specify the name and location of the SAS data file, which will normally have a .
sas7bdat extension, for the
Location connection property, as shown below.
OutputDataSource(Output, "The output data source")
ConnectionString = "Provider=mrOleDB.Provider.2; _
Data Source = mrSasDsc; _
Location = <Name and location of .sas7bdat file>"
End OutputDataSource
The SAS DSC writes the SAS program (.sas) file to the same location as the SAS data (.sas7bdat) file.
Example
This example OutputDataSource section is taken from the
RDBToSAS.dms sample file, which is installed with the UNICOM Intelligence Developer Documentation Library. For more information, see
Sample DMS files.
OutputDataSource(myOutputDataSource)
ConnectionString="Provider=mrOleDB.Provider.2; _
Data Source=mrSasDsc; _
Location=C:\Program Files\IBM\SPSS\DataCollection\7\DDL\Output\RDBToSAS.sas7bdat"
End OutputDataSource
See also