看起来当您添加 VARNUM 选项时,没有创建 VARIABLES 输出对象,而是创建了一个名为 POSITION 的输出对象。查找过程产生的不同对象的最简单方法是使用 ODS TRACE:
52 ods trace on;
53 proc contents data=sashelp.class;
54 run;
Output Added:
-------------
Name: Attributes
Label: Attributes
Template: Base.Contents.Attributes
Path: Contents.DataSet.Attributes
-------------
Output Added:
-------------
Name: EngineHost
Label: Engine/Host Information
Template: Base.Contents.EngineHost
Path: Contents.DataSet.EngineHost
-------------
Output Added:
-------------
Name: Variables
Label: Variables
Template: Base.Contents.Variables
Path: Contents.DataSet.Variables
-------------
55
56 proc contents data=sashelp.class varnum;
57 run;
Output Added:
-------------
Name: Attributes
Label: Attributes
Template: Base.Contents.Attributes
Path: Contents.DataSet.Attributes
-------------
Output Added:
-------------
Name: EngineHost
Label: Engine/Host Information
Template: Base.Contents.EngineHost
Path: Contents.DataSet.EngineHost
-------------
Output Added:
-------------
Name: Position
Label: Varnum
Template: Base.Contents.Position
Path: Contents.DataSet.Position
-------------
58 ods trace off;
看到这一点,您可以将代码更改为 SELECT 位置输出对象,即:
ods select position;
proc contents data=sashelp.class varnum;
run;
ods select all;