Database Reference
In-Depth Information
The following information was printed onto the SAS log when the “Save as H TML” option was selected.
This code was generated by SAS and resulted in the output HTML data being placed into a file on my
computer using the SAS FILENAME statement to define the output location.
1 filename _temp_ "C:\ My_HTLM_Output \Shoes.html";
2 ods noresults;
3 ods listing close;
4 ods chtml file=_temp_ rs=none;
NOTE: Writing CHTML Body file: _TEMP_
5 proc print data=Sashelp.'Shoes'N noobs;
6 run;
NOTE: There were 395 observations read from the data set SASHELP.SHOES.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.15 seconds
cpu time 0.09 seconds
7 ods chtml close;
8 ods results;
9 ods listing;
10 filename _temp_;
NOTE: Fileref _TEMP_ has been deassigned.
1.4.5 Using the “Vie w in Excel” Option to Copy Data to Excel Files via HTML
Example 1.4.5
The “Vie w in Excel” option also generates an HTML file. This file is saved in your SAS Work directory as
a text file of HTML commands with the extension *.xls. The file is not visible in the SAS Explorer window
and Excel is invoked to open the file. The file will typically have a name similar to “#LNxxxxxx.xls”. This
naming convention dates back to when all file names were limited to 8 characters in length and had a 3-
character extension. This file-naming structure is known as the “8.3” format for names that were in use
before SAS and Microsoft Windows could support long file names. The 3-byte extension (xls) allows Excel
to open the file without hesitation before Excel 2007. The newer versions check the contents of the file and,
if the file name ends in .xls but contains HTML or XML formatted commands for Excel, then a message is
displayed asking you to verify that you want to proceed (see Figure 1.4.4).
Figure 1.4.4: Warning Message Shown when Excel 2007 or Later Opens the Generated
HTML File.
The SAS log output below is similar to the listing output in Example 1.4.4, but has the addition of the
Display Manager command at the bottom of the log. The “winexecfile” command caused the named file to
be opened with the application that is associated with the file extension. In this case, it would be Excel.
 
Search WWH ::




Custom Search