SAS Catalog

Accepted Solution Solved
Reply
Super Contributor
Posts: 1,040
Accepted Solution

SAS Catalog

Hi ,

I have difficulty understanding the basic terminology in SAS

What is the difference between "SAS Catalog" and a "SAS Library"???

I have the below definition from SAS documentation and it says "Catalog is a valid SAS name for the file"?????

Could you please help me understand this???

libref:

is the logical name of the SAS library to which the catalog belongs.

catalog

is a valid SAS name for the file.

SAS(R) 9.2 Language Reference: Concepts, Second Edition

Also in the below DEF.XYZ......what is XYZ???? is it a dataset in DEF library???????

If you specify FMTSEARCH=(ABC DEF.XYZ GHI), SAS searches for requested formats or informats in this order:

  1. WORK.FORMATS
  2. LIBRARY.FORMATS
  3. ABC.FORMATS
  4. DEF.XYZ
  5. GHI.FORMATS.

Accepted Solutions
Solution
‎03-06-2015 12:51 PM
Super User
Posts: 10,550

Re: SAS Catalog

LIBRARY.Formats is a special case for keeping track of the SAS supplied formats. You can't actually access it or add a catalog to it.

If you add a library to the FMTSEARCH and the formats are stored in a catalog other than FORMATS then they will not be found. The specific catalog name must be included.

View solution in original post


All Replies
Super User
Posts: 10,550

Re: SAS Catalog

Basically libraries can contain just about any SAS file, data set , data view, catalog.

Catalogs are special files that contain, generally, related items. Some of the things besides formats are menus, icons, code for applications, key definitions, GIS Layers and projects and some other specialties.

Your question about DEF.XYZ: By default if a LIBRARY is mentioned in the FMTSEARCH path then it looks for a catalog named FORMATS. But you can create a catalog with any valid catalog name and it may contain formats. So you need to reference the Library and specific catalog name. In this case the catalog containing formats is named XYZ and resides in the DEF library.

Use the SAS Explorer to open some of the catalogs in the SASHELP library and you'll see a variety of things.

Super Contributor
Posts: 1,040

Re: SAS Catalog

Thanks Ballard,

That was very helpful information.

Also In the below what does he mean by LIBRARY.FORMATS???Does it mean if we mention the library and does not specify any catalog it will search for FORMATS catalog in that library????if XYZ catalog is present in that Library it will ignore since we did not specify it????

If you specify FMTSEARCH=(ABC DEF.XYZ GHI), SAS searches for requested formats or informats in this order:

  1. WORK.FORMATS
  2. LIBRARY.FORMATS
  3. ABC.FORMATS
  4. DEF.XYZ
  5. GHI.FORMATS.
Solution
‎03-06-2015 12:51 PM
Super User
Posts: 10,550

Re: SAS Catalog

LIBRARY.Formats is a special case for keeping track of the SAS supplied formats. You can't actually access it or add a catalog to it.

If you add a library to the FMTSEARCH and the formats are stored in a catalog other than FORMATS then they will not be found. The specific catalog name must be included.

Super User
Super User
Posts: 6,502

Re: SAS Catalog

LIBRARY is just a normal libref, but it has special impact on format searching because the normal default setting for the FMTSEARCH option is (WORK LIBRARY).

If you look at a SAS program from 20+ years ago you will see that the libref LIBRARY is usually assigned to find the company standard format library or perhaps a project standard format library.

Now a days you can use FMTSEARCH to point to a specific catalog (two level name like PROJECT.NEWFMTS) or libref (one level name).  When you use just a one level name it is interpreted as meaning the FORMATS catalog in that libref.

🔒 This topic is solved and locked.

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

Discussion stats
  • 4 replies
  • 229 views
  • 3 likes
  • 3 in conversation