SAS 扩展属性是您在 SAS 代码中定义的元数据,用于导入表脚本、标签、长度和类型之类的信息。您将扩展属性与某个数据集或变量关联,并以名称 - 值对的形式定义它们,如_JMP_TABLESCRIPTNAME_2="OnOpen"。详细信息,请参见关于扩展属性的 SAS 文档,网址为 http://sas.com/。
/* specify two table scripts. */
%LET _DS_ATTRIBUTES=_JMP_TABLESCRIPTCOUNT=2
/* define the table script names */
_JMP_TABLESCRIPTNAME_1="Favorite Movie By State"
_JMP_TABLESCRIPTNAME_2="OnOpen"
_JMP_TABLESCRIPTVALUE_2="CurrentDataTable() << RunScript(""Favorite Movie By State"");"
/* define the OnOpen table script */
_JMP_TABLESCRIPTVALUE_1=
/* a portion of the OnOpen table script */
"
Current Data Table();
New Column(""max_name"",
Character,
Width(128)
);
下例显示如何使用扩展属性组合 PROC DATASETS:
%LET _DS_ATTRIBUTES = attr-name=attr-value...attr-name=attr-value;
%LET _VAR_ATTRIBUTES= var-name (attr-name=attr-value...)...var-name (attr-name=attr-value...);
PROC DATASETS NOLIST LIB=WORK;
MODIFY AttributeReferenceTable;
XATTR OPTIONS MAXCHUNK=100;
XATTR SET DS &_DS_ATTRIBUTES;
XATTR SET VAR &_VAR_ATTRIBUTES;
RUN;
QUIT;
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
sd = dt << Make SAS Data Step Window( SaveJMPMetadata( 1 ) );