DATA Step, Macro, Functions and more

Generate dynamically

Reply
Super Contributor
Posts: 687

Generate dynamically

How to create a dataset dynmaically with the following below columns  (metadata of columns in datasets generated without passing any hardcoding)?

 DatasetName DatasetLabel VariableName VariableLabel DataType Length SASFormat

Super User
Posts: 21,448

Re: Generate dynamically

Try SASHELP.VTABLE and/or SASHELP.VCOLUMN.

 


SASPhile wrote:

How to create a dataset dynmaically with the following below columns  (metadata of columns in datasets generated without passing any hardcoding)?

 DatasetName DatasetLabel VariableName VariableLabel DataType Length SASFormat


 

 

Highlighted
Super User
Posts: 12,148

Re: Generate dynamically

This will get descriptions of the tables that contain the data you want:

 

proc sql;
describe table dictionary.tables ;

describe table dictionary.columns ;
quit;

You'll have to describe the "dynamic" part as I don't see any.

 

 

Use Proc Sql to join the two dictionary tables on Libname and memname, request the other information you want and perhaps subset to the libname and/or data sets you want (is this the "dynamic" part?);

PROC Star
Posts: 1,065

Re: Generate dynamically

Ask a Question
Discussion stats
  • 3 replies
  • 96 views
  • 0 likes
  • 4 in conversation