Path to mathematics-sas memo (5), path to mathematics-sas memo
Import and export data
PROC IMPORT
DATAFILE = "file name" // specifies the complete path and file name of the file to be imported
OUT = logical reference database name. Dataset
DBMS = import file type
<REPLACE> // if this flag exists, it indicates that the existing SAS dataset is overwritten.
<Import file option>
All content of this blog is original, if reproduced please indicate the source http://blog.csdn.net/myhaspl/
PROC EXPORT
DATA = logical reference database name. dataset // specifies the dataset to Be Exported
<SAS dataset Options>
OUTFILE = "file name" | OUTTABLE = "tablename" // specifies the full path and file name of the file to be exported
DBMS = export file type
<REPLACE> // if this flag exists, it indicates that the existing file with the same name is overwritten.
<File export options>
The file types are as follows:
ACCESS: microsoft access
CSV: comma-separated files
EXCEL: EXCEL files
SAV: SPSS File
DTA: stata File
TAB: text file of the tab Separator
DLM: delimiter file (space by default)
==========
* Export an excel file at http://blog.csdn.net/myhaspl /*;
Libname myclass "E: \ sasdata ";
PROC EXPORT
DATA = myclass. student
OUTFILE = "e: \ sasdata \ mystudent.xlsx"
DBMS = EXCEL
REPLACE;
Run;
The log is as follows:
23 * export the excel file at http://blog.csdn.net/myhaspl /*;
24 libname myclass "E: \ sasdata ";
NOTE: The logical Library Reference name "MYCLASS" has been successfully allocated, as shown below:
Engine: V9
Physical name: E: \ sasdata
25 PROC EXPORT
26 DATA = myclass. student
27 OUTFILE = "e: \ sasdata \ mystudent.xlsx"
28 DBMS = EXCEL
29 REPLACE;
30 run;
NOTE: The "STUDENT" range/worksheet is created successfully.
NOTE: time used for "procedure export" (total processing time ):
Actual Time: 0.20 seconds
CPU time: 0.07 seconds