BookmarkSubscribeRSS Feed
shahrushabh2710
Fluorite | Level 6

I have a folder names samples and there are n number of SAS files... all i need to do is extract Column Names, Datatype, Size and # of Records and dump it into an excel spreadsheet.

 

The desired spreadseet is attached.

 

PS: I am new to the SAS world so please answer the code with explanation if possible.

 

Thanks in advance.

Rushabh Shah

3 REPLIES 3
amadhavi41
Fluorite | Level 6

Use below Contents procedure to get Column Names, Datatype, Size etc from SAS file by giving library name.

Repeat this or write a macro to get all the librarie's SAS files info and collate to one single SAS file.

 

proc contents data=&inlib..&indata out=contdata;
run;

 

Export sas dataset contdata to an excel file using proc export.

LinusH
Tourmaline | Level 20
For Base SAS libraries, SAS gathers this information automatically for you. Just look in the sashelp.vstable and sashelp.column views. No need for coding unless you wish to format a report on it.
Data never sleeps

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
  • 3383 views
  • 0 likes
  • 3 in conversation