BookmarkSubscribeRSS Feed
raja777pharma
Fluorite | Level 6

Hello ,

For my scenario i need to find out is exist XPT file have how many observations.

 

I used Proc contents for out put meta data set NOBS variable values are showing missing

 

Please help to  find out number of observation in XPT file with out converting in to SAS data set

3 REPLIES 3
MCoopmans
SAS Employee

Hello,

 

I asume that the XPT file was made with the xport engine. I guess the only way is to count the number of observations since the descriptor shows a missing value.

 

libname ppp xport "c:\temp\cccc.xpt";

data ppp.class; 
 set sashelp.class;
run;

proc sql;
 select count (*) from ppp.class;
 quit;

Hope that helps!

Tom
Super User Tom
Super User

You will have to count them since the SAS v5 export format does not have any location to store the number of observations.

Either use PROC SQL or a data step with the END= option on the SET statement.

smantha
Lapis Lazuli | Level 10
libname ppp xport "c:\temp\cccc.xpt";

data ppp.class; 
 set sashelp.class;
run;

data _null_;
set ppp.class nobs=obs;
put obs=;
stop;
run;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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