Learning SAS? Welcome to the exclusive online community for all SAS learners.

What are .sas7bcat and .sas7bndx files?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 7
Accepted Solution

What are .sas7bcat and .sas7bndx files?

All I've been able to determine is formats.sas7bcat is a "format catalog" and patients.sas7bndx "defines the index for the patients data set."  But, what information do these two types of files contain?  How do I access and display their contents?  I'm using SAS University Edition with SAS Studio.  Thanks!


Accepted Solutions
Solution
Monday
Community Manager
Posts: 3,024

Re: What are .sas7bcat and .sas7bndx files?

[ Edited ]

You should be able to assign the lib to My Folders and report on the formats.

 

libname fmt '/folders/myfolders';

/* maybe not needed */
options fmtsearch=(work fmt library);

proc format lib=fmt fmtlib;
run;   

 

 

 

View solution in original post


All Replies
Super User
Posts: 8,069

Re: What are .sas7bcat and .sas7bndx files?

.sas7bcat are SAS catalogs, consult the documentation, as in here: https://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a002300187.htm

.sas7bndx are index files that contain an index defined for a dataset.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Community Manager
Posts: 3,024

Re: What are .sas7bcat and .sas7bndx files?

Index files (SAS7BNDX) are companions to SAS7BDAT (data files).  You don't look at them directly (like the sun), but instead you can see them indirectly by examining INDEX definitions in PROC DATASETS.

 

Catalog files (SAS7BCAT) are contain a diverse set of "catalog entries", which can include SAS format and informat definitions, and SAS compiled macros.  Those are the two items most likely to concern you within SAS Studio.  Other catalog entry types apply more to the windowing environment in "Base SAS".

 

You can use PROC CATALOG to manage these entries. Use FILENAME CATALOG method to read the contents of text-based entries (such as SOURCE).  And use PROC FORMAT with SELECT to describe user-defined formats/informats.

 

You can also use SASHELP.VCATALG to explore some of the contents.

 

proc sql;
 select * from sashelp.vcatalg where libname="WORK";
quit;
Super User
Posts: 11,578

Re: What are .sas7bcat and .sas7bndx files?

Proc format will also tell more details of the contents of a format catalog.

 

Proc format library=work fmtlib;

run;

 

will wrote the name and and some details of formats and informats in a Formats catalog in the Work library to the Results window.

or

 

proc format library=work cntlout=work.formatcontents;

run;

 

will send the contents of the formats to a data set. The structure of that data set is the one that would be used to create formats using the cntlin= option for proc formats. Not all of the values are needed but you can see them.

Occasional Contributor
Posts: 7

Re: What are .sas7bcat and .sas7bndx files?

Thank you all for your quick replies.  Smiley Happy  But, I am not a SAS user (heavy JMP user) and am trying to see the contents of the two files I mentioned: formats.sas7bcat and patients.sas7bndx.  I was able to directly access, read, and analyze the (associated) data set patients.sas7bdat with JMP, but my client thinks other information / data may be in the two other files (I don't).  So, that's why I just want to display their contents.

 

I've tried many SAS statement variations (after poking around in the documentation, FAQs, other Community postings, etc.), and I've just tried what y'all have shown in your replies - to no avail...all result in an error statement of one kind or another.  I need the exact SAS statements needed to display the contents (in a readable format) of formats.sas7bcat and patients.sas7bndx in the Results tab of SAS Studio.

 

Many thanks for your patience!  Smiley Happy

Super User
Posts: 20,236

Re: What are .sas7bcat and .sas7bndx files?

There's no relevant content in the index file. It's a look up file that SAS uses to increase the efficiency of the data set, or think of it as a index like you find in the back of a text book. You look up the topic in the index and then find the correct page. I believe it's stored in a binary format as well, and it doesn't have an easy way to be viewed. It's not intended for people to look at or work with, its a system file. 

 

The Catalog may have relevant information and you've been provided with instructions on how to use it. This may have formats that are relevant. 

Super User
Posts: 11,578

Re: What are .sas7bcat and .sas7bndx files?

[ Edited ]

waynergf wrote:

Thank you all for your quick replies.  Smiley Happy  But, I am not a SAS user (heavy JMP user) and am trying to see the contents of the two files I mentioned: formats.sas7bcat and patients.sas7bndx.  I was able to directly access, read, and analyze the (associated) data set patients.sas7bdat with JMP, but my client thinks other information / data may be in the two other files (I don't).  So, that's why I just want to display their contents.

 

I've tried many SAS statement variations (after poking around in the documentation, FAQs, other Community postings, etc.), and I've just tried what y'all have shown in your replies - to no avail...all result in an error statement of one kind or another.  I need the exact SAS statements needed to display the contents (in a readable format) of formats.sas7bcat and patients.sas7bndx in the Results tab of SAS Studio.

 

Many thanks for your patience!  Smiley Happy


We cannot provide the exact statements as you have not told us what library any of these appear in.

 

Did you try modifying either of the Proc format solutions I posted? The cntlout data set can be displayed with proc print, just like any other data set. The FMTLIB option sends output direct to the results window.

 

There is a certain danger in assuming formats do not contain information. If there is a custom format designed to display numeric values such as 1,2,3 as text such as "New York", "Some Company Name, Inc" or similar then you will need to have some other key elsewhere to discover the meanings of you actual values.

Proc contents will tell if there are associated formats. If those formats appear in the format catalog the information may be critical to understanding it for use.

Occasional Contributor
Posts: 7

Re: What are .sas7bcat and .sas7bndx files?

Thanks, bollardw, for hanging with me.  Yes, I've tried several variations of the PROC FORMAT statement, get an error(s) every time.  As for specifying a LIBRARY (if I even have one), I've tried but getting that wrong, too.  My formats.sas7bcat file is in My Folders in the Navigation Pane of SAS Studio (see attachment).

 
And indeed you are right: what is driving my need to know what's in the formats.sas7bcat file is that the variables in patients.sas7bdat use coded values and in some instances the hardcopy definitions of the codes are missing or obviously wrong.  So my client hopes the correct definitions are in formats.sas7bcat.
Solution
Monday
Community Manager
Posts: 3,024

Re: What are .sas7bcat and .sas7bndx files?

[ Edited ]

You should be able to assign the lib to My Folders and report on the formats.

 

libname fmt '/folders/myfolders';

/* maybe not needed */
options fmtsearch=(work fmt library);

proc format lib=fmt fmtlib;
run;   

 

 

 

Occasional Contributor
Posts: 7

Re: What are .sas7bcat and .sas7bndx files?

Posted in reply to ChrisHemedinger

Thanks, Chris.  I (perhaps naively) ran the statements exactly as you gave them, and got the attached (bottom half of Word file).

  

Is "File FMT.FORMATS.CATLOG" referring to my formats.sas7bcat file, and if so, does that mean my file is unreadable using SAS Studio?  Or do I need to replace something in your code with my file name (not clear to me where that would be)?
Super User
Posts: 20,236

Re: What are .sas7bcat and .sas7bndx files?


waynergf wrote:

Thanks, Chris.  I (perhaps naively) ran the statements exactly as you gave them, and got the attached (bottom half of Word file).

  

Is "File FMT.FORMATS.CATLOG" referring to my formats.sas7bcat file, and if so, does that mean my file is unreadable using SAS Studio?  Or do I need to replace something in your code with my file name (not clear to me where that would be)?

No attachment or documents.

Occasional Contributor
Posts: 7

Re: What are .sas7bcat and .sas7bndx files?

Whoops - forgot to attach.  SAS Studio log notes (bottom half of Word doc) as a result of Chris' SAS statements.

Super User
Posts: 11,578

Re: What are .sas7bcat and .sas7bndx files?

SAS catalogs have file structures that are not very compatible across versions unlike the Sas data sets.

If you are getting a error with text similar to:

 

ERROR: File mylib.formats.catalog was created for a different operating system.

 

They you will not get anything from the file. Different operating system can also mean changing across one of the SAS versions such as SAS 9.2 format catalogs are not compatible with SAS 9.3, SAS 9.3 not compatible with SAS 9.4 even running under the same operating system as the structures of the files changed. The option there is to find a version of SAS that they are compatible with or a slim chance of some third-party conversion utility.

 

SAS provides specific procedures for preparing movement of catalogs across versions but the special files are required to be created in the version saving from.

 

Which is why for my permanent libraries that store SAS formats has the Proc Format option cntlout to create a basic data set that can be used to recreate the formats if the SAS code gets lost or corrupted.

 

You might see if the code files for this project, if any, contain Proc Format statements or some documentation related to formats. Otherwise you may well be stuck as far as examining the existing catalog you have.

Community Manager
Posts: 3,024

Re: What are .sas7bcat and .sas7bndx files?

Here's a trick to find out what operating system created that catalog file.

 

filename test "/folders/myfolders/formats.sas7bcat";
data enc (keep=encoding); 
 length encoding $ 20;
 infile test truncover scanover; 
 input @'9.0' enc $14.; 
 encoding = '9.0' || enc; 
run; 

Result should show something like "9.0202M0Linux" or "9.0401B0X64_7PRO" or "9.0401B0W32_7PRO".

 

You can then begin your search for the person who has that version of SAS installed on the proper platform Smiley Happy

Occasional Contributor
Posts: 7

Re: What are .sas7bcat and .sas7bndx files?

Posted in reply to ChrisHemedinger

Thanks, Chris, for going the "extra mile."  :-)  I ran the SAS statements exactly as you listed them and got this in SAS Studio Log (second page of attached Word doc).  SAS Studio Output has this (third page of Word doc).  :-(

 

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 17 replies
  • 295 views
  • 12 likes
  • 5 in conversation