【发布时间】:2015-08-14 20:09:31
【问题描述】:
我正在尝试限制 ODS 输出表中包含的观察数。 我的尝试非常基础:
OPTIONS NODATE number pageno=1 rightmargin=0.25in leftmargin=0.25in topmargin=0.4in bottommargin=0.4in;
options sysprintfont=("SAS Monospace" normal regular 8 ALL) orientation=landscape;
ODS LISTING CLOSE;
ODS NORESULTS;
ods TAGSETS.EXCELXP PATH="C:\TEMP" FILE= "&Place._RequiredFlaggedRecords.XML" STYLE=NORMALPRINTER;
/*Sets number of observations allowed per ODS*/
%let obs=100;
ODS TAGSETS.EXCELXP OPTIONS (EMBEDDED_TITLES='YES' EMBEDDED_FOOTNOTES='YES' SHEET_NAME='Outdated');
proc print data=&Place (obs=&obs) (rename = (CREATE_DATE = DATE_PROCESSED EARLIEST_DATE_TIME=VISIT_DATE_TIME EARLIEST_DATE=VISIT_DATE)) noobs;
var
DATEDIFF
DATE_PROCESSED
VISIT_DATE
VISIT_DATE_TIME
;
WHERE DATEDIFF >=60 ;
title1 j=l "Outdated Records " ;
title2 j=l 'This page reflects the records which were received more than 60 days following';
RUN;
日志文件返回:
NOTE: Line generated by the macro variable "OBS".
1 100
---
22
76
ERROR 22-322: Expecting a quoted string.
ERROR 76-322: Syntax error, statement will be ignored.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.09 seconds
cpu time 0.01 seconds
尝试使用%eval 将 100 变成数字而不是字符。还将 &obs 替换为 100 而不是使用宏。两者的结果都与上述相同。
任何帮助将不胜感激!
【问题讨论】:
-
如上所述,我尝试了其他方法都无济于事。我所有的研究都表明这 3 种方法都应该有效,但没有一个有效。