Proc export can export two types of files:
- Export the delimited file
1 * example; 2 proc export data = hotels 3 OUTFILE = 'C: \ myrawdata \ Alibaba s.txt '/* The suffix name determines the format of the output file. In addition, the value can also be specified using the DBMS = option. */4/* For example, if the space-delimited file does not have a standard suffix, you can only use the DBMS = option to output */5 DBMS = DLM/* If the CSV file is output, DBMS = CSV; 6. If the TXT file is output, DBMS = tab; 7 if the spaced-delimited file is output, DBMS = DLM */8 replace; /* replace an existing file with the same name */9 delimiter = '&';/* If delimiter = is used, no matter what suffix is used, the file will output the separator file specified in this statement */10 run;
- PC File Export: Applicable to Microsoft Excel, Lotus (excluding UNIX), dBase, Microsoft Access, JMP, paradox, SPSS, Stata
1. General Form of output PC files (except Microsoft Access): Proc export data = data-set OUTFILE = 'filename' DBMS = DBMS-identifier replace; sheet = 'sheet-name';/* is only required when you need to customize the sheet name. By default, the sheet name is the same as that of the SAS dataset. note: sheet-name cannot end with $ */run. [file suffixes of various PCs and corresponding DBMS identifier] type of file suffix DBMS identifier Microsoft Excel :. XLS ------------- Excel (32-bit windows) ----------- XLS (Unix or 64-bit windows) DBASE. DBF ------------ dbf jmp. JMP ------------ JMP Lotus. wk4 ------------ wk4 paradox. DB ------------ paradox SPSS save file. sav ----------- sav Stata. DTA ------------ DTA 2. General Form of output Microsoft Access File: Proc export data = data-set outtable = 'filename'/* specifies the table name in the database, note that outtable */DBMS = DBMS-identifier;/* The suffix of the Microsoft Access file is. mdb, DBMS identifier is access (97) or Access97 (00 or 03) */database = 'filename '; /* specify the Microsoft Access database to be modified or created */run;