2016-08-24 6 views
2

Ich habe den folgenden CodeWarum stoppt Varnum proc Inhalte in sas?

ods select Variables; 
    proc contents data=xmlout.&XML_DSET; 
    run; 

Die ods pdf Open-Anweisung ist früher im Code

ods pdf file="&exceldir\README.pdf" startpage=never; 
title 'README FILE'; 

Dies geschieht xmlout. & XML_DSET und schön stellt es in eine pdf für mich (die ods pdf schließen; ist später im Code).

Jedoch!

Wenn ich varnum setzen, um zu bestellen als Variable wie im Datensatz vorhanden ist, so

ods select Variables; 
    proc contents data=xmlout.&XML_DSET varnum; 
    run; 

Die PDF-Anzeige nicht die Ergebnisse überhaupt nicht!

Was mache ich falsch?

Danke!

Antwort

4

Wenn Sie die VARNUM-Option hinzufügen, wird das Ausgabeobjekt VARIABLES nicht erstellt, stattdessen wird ein Ausgabeobjekt namens POSITION erstellt. Der einfachste Weg, um die verschiedenen Aufgaben durch ein Verfahren hergestellt zu finden ist ODS TRACE zu verwenden:

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; 

, dass das Sehen, können Sie Ihren Code ändern, um die Position Ausgabeobjekt auf SELECT, d.h .:

ods select position;  
proc contents data=sashelp.class varnum; 
run; 
ods select all;