我试图限制 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 而不是使用宏。两者的结果与上述相同。
任何帮助,将不胜感激!