各位大侠,请教个SAS help里面的示例的问题:
http://support.sas.com/documentation/cdl/en/acpcref/67382/HTML/default/viewer.htm#n0msy4hy1so0ren1acm90iijxn8j.htm
SAS/ACCESS 9.4 Interface to PC Files: Reference, Second Edition
Import and Export Microsoft Excel Files Using XLS and XLSX Drivers
Example 1: Export SAS Data Sets to Excel 2010 Workbook and Replace Sheets
This example exports the SAS data sets, SDF.INVOICE and SDF.ORDERS, to an Excel 2010 workbook with Invoice and Orders as sheet names. The Invoice and Orders sheets already exist, and REPLACE in each PROC EXPORT statement is used to overwrite or replace the data in these sheets. When you use REPLACE at the sheet level, the range includes the entire sheet (and not a subset of cells).
/*************************************************/
LIBNAME SDF V9 "&sasdir";
PROC EXPORT DATA=SDF.INVOICE
FILE="&tmpdir.text.xlsx"
DBMS=XLSX REPLACE;
SHEET=’Invoice’;
RUN;
PROC EXPORT DATA=SDF.ORDERS
FILE="&tmpdir.text.xlsx
DBMS=XLSX REPLACE;
SHEET=’Orders’;
RUN;
/*************************************************/
问题是,我copy这段代码,在SAS里面运行报错呀。
10 LIBNAME SDF V9 "&sasdir";
WARNING: Apparent symbolic reference SASDIR not resolved.
NOTE: Library SDF does not exist.
11 PROC EXPORT DATA=SDF.INVOICE
12 FILE="&tmpdir.text.xlsx"
WARNING: Apparent symbolic reference TMPDIR not resolved.
。。。。。。
还有好多syntax 错误。
我个人感觉,好像&sasdir 和 &tmpdir都没有定义,开始我还以为是系统自动的宏变量呢,结果报错。
另外PROC EXPORT 导出文件名 好像是用的OUTFILE = 不知道为什么示例里面用的是 File=?
本人初学SAS,希望大侠指点指点。
万分感谢!!