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

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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