BookmarkSubscribeRSS Feed
Debi
Fluorite | Level 6

Hi there,

 

I have a big dataset. I want to see no of observations of that dataset. When  I use 'Proc contents' , it gives me a missing value {dot(.)} against the "observations" field.

 

Is there any other way, I can get this no of observation. I don't want to use Proc sql;select count(*) as it takes a lot of time to display the output .

 

Thanks,

Debi

 

3 REPLIES 3
Astounding
PROC Star

The typical cases where you can't see the number of observations in your SAS data set:  you don't really have a SAS data set.  You might have a view instead, or you might have access to a table that can be treated as a SAS data set but is really stored in an external data base format.  The output from PROC CONTENTS might provide some of those details.

 

It is likely that you have no choice but to wait for the COUNT(*) method to finish.  (If there is an external data base involved, you may be able to switch to pass-through SQL, but that's jumping ahead of the game right now.)

Clash
Obsidian | Level 7
Here is what you want;
data _null_;
if 0 then set test nobs=nobs;
call symputx(”nobs”,nobs);
stop;
run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 949 views
  • 0 likes
  • 4 in conversation