Database Reference
In-Depth Information
*======================================================================;
* Set up a filename command to point to a range of Excel cells *;
*======================================================================;
% out_range
(file_ref = Hello_W, /* fileref to use for output */
path_name = C:\Excel_Files\, /* Excel file path */
file_name = Book1.xls, /* Excel file name */
Start_row_Col = R1C1, /* must use the R1C1 format */
End_row_col = R1C2, /* must use the R1C1 format */
no_tab = YES, /* change tab setting option */
L_REC_L = 20 ); /* change output Logical len */
*======================================================================;
* Set up a filename command to point to a range of Excel cells *;
*======================================================================;
% out_range
(file_ref = Hello_X, /* fileref to use for output */
path_name = C:\Excel_Files\, /* Excel file path */
file_name = Book1.xls, /* Excel file name */
Start_row_Col = R4C1, /* must use the R1C1 format */
End_row_col = R4C2, /* must use the R1C1 format */
no_tab = NO, /* change tab setting option */
L_REC_L = 30 ); /* change output Logical len */
*======================================================================;
* This data step writes data to the defined Excel range using the file*;
* command and the put command. Filerefs "Hello_w" and "Hello_x" are *;
* defined by the out_range macro *;
*======================================================================;
data _null_;
Hello = 'Hello';
World = 'World';
file Hello_w;
put hello $char6. World $char6.;
file Hello_x;
put hello $char6. World $char6.;
run ;
*======================================================================;
* This macro saves the output file *;
*======================================================================;
% save_Excel
(file_ref = commands, /* fileref to use for output*/
path_name = C:\Excel_Files\, /* Excel file path */
file_name = Book1.xls); /* Excel file name */
*======================================================================;
* This macro closes the Excel file. *;
*======================================================================;
% Close_Excel (file_ref = commands); /* fileref to close */
run;
Search WWH ::




Custom Search