SAS ODS文档语法错误

时间:2016-10-20 16:50:46

标签: sas ods

我对消耗臭氧层物质系统有很多疑问,我正在努力教育自己。但是,由于SAS文档示例生成错误,我无法这样做。

相关文档为Controlling Where Your Output Is Stored

第一个例子是,逐字,

/* Specify the ODS output path */
filename odsout ".";

goptions reset=all;
ods _all_ close;
ods pdf path=odsout file="mygraph.pdf";
proc gchart data=sashelp.prdsale;
   vbar Product / sumvar=actual;
      title1 "First Quarter Sales in Canada";
      where Quarter=1 and Country="CANADA";
   run;
quit;
ods pdf close;
ods html; /* Not required in SAS Studio */

"."声明中的filename似乎是一个类似"C:\your\file\path\here\"的占位符。

我已将其替换为"C:\output"。当我这样做时,我收到以下错误:

6    ods pdf path=odsout file="mygraph.pdf";
             ----
             22
             76
ERROR 22-322: Syntax error, expecting one of the following: ;, (, ANCHOR, AUTHOR, BACKGROUND, BASE,
              BODY, BOOKMARK, BOOKMARKGEN, BOOKMARKLIST, BOX_SIZING, CLOSE, COLOR, COLUMNS, COMPRESS,
              CONTENTS, CSSSTYLE, DISPLAY, DOM, DPI, EXCLUDE, FILE, FONTSCALE, GFOOTNOTE, GTITLE,
              HOST, KEYWORDS, NAMED_DEST, NEWFILE, NOBACKGROUND, NOBOOKMARKGEN, NOBOOKMARKLIST,
              NOCOLOR, NOCONTENTS, NOGFOOTNOTE, NOGTITLE, NOPDFNOTE, NOTOC, PACKAGE, PCL, PDF,
              PDFMARK, PDFNOTE, PDFTOC, PRINTER, PS, SAS, SELECT, SGE, SHOW, STARTPAGE, STYLE,
              SUBJECT, TEXT, TITLE, UNIFORM.
ERROR 76-322: Syntax error, statement will be ignored.

我做错了什么或者这个例子的作者在发布之前没有编译?

1 个答案:

答案 0 :(得分:1)

似乎path选项在ods html中有效,但在ods pdf中无效,但无关紧要,因为您可以在file中指定绝对路径选项。

ods pdf file="C:\temp\mygraph.pdf";