BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
RALL
Obsidian | Level 7

I have a number of tables that I would just like to write a bit of code to just show the headings of the columns and the count of the rows with data in under each column. 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
Have you looked at PROC CONTENTS and OUT= data sets?

A data set has the same number of rows for each column so you may want to be more descriptive than count of rows.

If you're looking for table and # of rows per table check out sashelp.vtable.

For column information check out sashelp.vcolumn

View solution in original post

4 REPLIES 4
PeterClemmensen
Tourmaline | Level 20

Welcome to the SAS Community 🙂

 

Where do you want the counts to be displayed? In a report or in a new data set or?

RALL
Obsidian | Level 7

Thanks 🙂 , just in a report. 

Reeza
Super User
Have you looked at PROC CONTENTS and OUT= data sets?

A data set has the same number of rows for each column so you may want to be more descriptive than count of rows.

If you're looking for table and # of rows per table check out sashelp.vtable.

For column information check out sashelp.vcolumn
RALL
Obsidian | Level 7

Thanks the sashelp.vtable did the trick.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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