BookmarkSubscribeRSS Feed
MaryA_Marion
Lapis Lazuli | Level 10

When I do a proc contents of the enclosed data set I am obtaining a description of what is inside - alphabetic list of variables and attributes, engine/host information observation length. Number of variables is 9, number of observations = 0.  Are there sas7bdat files that only give data structure information and where / how do I obtain the data? What sas statements should I use?

 

MM

 

13 REPLIES 13
novinosrin
Tourmaline | Level 20

Hi @MaryA_Marion   Are you asking how to view the data portion of a SAS dataset rather than the descriptor(metadata) portion of the dataset? If yes, have you tried PROC PRINT?

MaryA_Marion
Lapis Lazuli | Level 10

Yes. I get a very interesting description of the data set but no data? I have looked at it in SAS U Editon and JMP.

 

MM

 

novinosrin
Tourmaline | Level 20

In your question, you've mentioned " number of observations = 0"  So even proc print wouldn't be of use as your dataset is an empty table. It only has a structure to hold records though none yet apparently.

Patrick
Opal | Level 21

Yes, it is possible to have a data set with no row of data.

The dataset you've posted contains multiple rows but it appears it's the description of some output table from a query  - likely executed against sashelp.vcolumn.

proc print data=work.churchdata;
run;

Capture.JPG

MaryA_Marion
Lapis Lazuli | Level 10
I wondered if this could be one of your help datasets like the car dataset?
MM
Patrick
Opal | Level 21

Below query will list all tables for which you've got a libname defined and which contain a column Receiver (one of the column names from your variable listing).

In my environment none of the tables under sashelp has such a column.

proc sql;
  select distinct libname, memname
  from sashelp.vcolumn
  where upcase(name)='RECEIVER'
  ;
quit;
MaryA_Marion
Lapis Lazuli | Level 10
Thanks. Interesting code I will keep around. I had the same results. MM
Reeza
Super User

SASHELP.VTABLE and SASHELP.VCOLUMN

 

VTABLE holds metadata about tables

VCOLUMN holds metadata about the variables in the data set

 

You can query these to find information on the data sets as needed. 

 


@MaryA_Marion wrote:

When I do a proc contents of the enclosed data set I am obtaining a description of what is inside - alphabetic list of variables and attributes, engine/host information observation length. Number of variables is 9, number of observations = 0.  Are there sas7bdat files that only give data structure information and where / how do I obtain the data? What sas statements should I use?

 

MM

 


 

MaryA_Marion
Lapis Lazuli | Level 10
Reeza ...
SASHELP.VTABLE and SASHELP.VCOLUMN
VTABLE holds metadata about tables
VCOLUMN holds metadata about the variables in the data set

MM

Thank you for your reply.
Ordinarily I would use "ods trace on" to find output tables but which tables do I refer to here?
proc sql data=perm.churchdata;
select distinct libname, memname
from sashelp.vtable
where upcase(table)='?'
;

Is it possible to unlock the data in this file?
quit;
*/

 

Kurt_Bremser
Super User

@MaryA_Marion wrote:
Reeza ...
SASHELP.VTABLE and SASHELP.VCOLUMN
VTABLE holds metadata about tables
VCOLUMN holds metadata about the variables in the data set

MM

Thank you for your reply.
Ordinarily I would use "ods trace on" to find output tables but which tables do I refer to here?
proc sql data=perm.churchdata;
select distinct libname, memname
from sashelp.vtable
where upcase(table)='?'
;

Is it possible to unlock the data in this file?
quit;
*/

 


Once again, use dictionary.columns (or the view for it, sashelp.vcolumn):

proc sql;
select * from dictionary.columns
where libname = "PERM" and memname = "CHURCHDATA";
quit;

 

Patrick
Opal | Level 21

@MaryA_Marion 

There is no other data in the file/table than what a Proc Print shows you.

Reeza
Super User
There is no data. If you tried to read it incorrectly, it's possible you accidentally overwrote it. Do you have a copy of the original file.
ballardw
Super User

@MaryA_Marion wrote:

When I do a proc contents of the enclosed data set I am obtaining a description of what is inside - alphabetic list of variables and attributes, engine/host information observation length. Number of variables is 9, number of observations = 0.  Are there sas7bdat files that only give data structure information and where / how do I obtain the data? What sas statements should I use?

 

MM

 


Here is an example of how to make a data set with only the structure of an existing data set but no observations:

data example;
   set sashelp.class (obs=0);
run;

But where to add the data from if you have one of these structure only sets depends on what you have.

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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 13 replies
  • 1199 views
  • 0 likes
  • 6 in conversation