BookmarkSubscribeRSS Feed
SASPhile
Quartz | Level 8

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

3 REPLIES 3
Reeza
Super User

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


 

 

ballardw
Super User

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?);

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 708 views
  • 0 likes
  • 4 in conversation