Database Reference
In-Depth Information
As shown in the examples in this chapter, the file-format-specific-statements are listed after the PROC
EXPORT statement. In other words, the statements after the first semicolon are independent statements that
modify PROC EXPORT. While no spaces are shown between the option names and the “=” sign, spaces
are usually permitted in this syntax.
Example 2.5 SAS Code to Export Data to an Excel File with No Column
Headers
This example outputs an Excel file using PROC EXPORT with the DBMS=XLS option. For this output,
either the “REPLACE” option or the NEWFILE= file format statements are valid. The PUTNAMES=NO
statement puts only the data without row or column headers. While the sheet name, because it is enclosed
in quotes, remains case sensitive, the spaces are replaced with underscores. SAS PROC EXPORT will not
write a sheet name with spaces.
Figure 2.12b: SAS Code That Outputs the Result without a Header Row.
PROC EXPORT DATA=sashelp.shoes
OUTFILE='C:\My_Files\shoes_to_xls.xls'
REPLACE
DBMS=XLS;
NEWFILE=YES;
PUTNAMES=NO;
SHEET='My Sheet Name';
RUN;
Figure 2.13: Screen Image from the Results of PROC EXPORT.
Example 2.6 SAS Code to Export Data to a Network Windows Computer
When writing SAS data to another computer, you need access to the other computer and shared ability to
write to the disk volume within the described path name.
Figure 2.14: SAS Code to Export Data to Another Computer.
PROC EXPORT DATA=sashelp.shoes
OUTFILE='\\owl-2000-xp\E_Drive\My_Files\shoes_to_xls.xls'
REPLACE
DBMS=XLS;
NEWFILE=YES;
SHEET='My Sheet Name';
RUN;
 
Search WWH ::




Custom Search