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
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?
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
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.
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;
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;
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
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;
*/
@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;
There is no other data in the file/table than what a Proc Print shows you.
@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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.