Path to mathematics-sas memo (5), path to mathematics-sas memo

Source: Internet
Author: User

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


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.