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

PROC CONTENTs data=demo varnum; run;

I have just used the above code VARNUM for programming for the first time.

I used this because I thought that I could use it to assess if the data was imported accurately. 

For this reason, I checked the Number of observations, variables, and also confirmed that value is 0 for both "Deleted Observations" & "Number of Data Set Repairs". 

 

Q1. Any other tips for using this varnum code? for any other purposes?

 

Q2. I am having a bit of difficulty understanding some keywords in this output, especially 

- indexes, observation length, number of data set pages, Max Obs per Page, Obs in First Data Page  (I don't quite get which "page" it is)

Could someone please tell me or suggests a webpage explaining these keywords?

 

 Thank you for your help in advance.

Capture SAS.PNG

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

SAS datasets are organized in "pages" of equal size. Observations are fit into a page by using the formula int(pagesize/observation length), the remaining space in a page is padded out.

Since the first page also contains the header information with all variable attributes, it has less space for observations.

Observation length is computed by adding up all variable lengths.

View solution in original post

1 REPLY 1
Kurt_Bremser
Super User

SAS datasets are organized in "pages" of equal size. Observations are fit into a page by using the formula int(pagesize/observation length), the remaining space in a page is padded out.

Since the first page also contains the header information with all variable attributes, it has less space for observations.

Observation length is computed by adding up all variable lengths.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 1 reply
  • 988 views
  • 1 like
  • 2 in conversation