SAS 9.1 Language Reference. Concepts
Authors: SAS Institute
Published year: 2004
Pages: 178-179/255
Buy this book on amazon.com >>

Profile Catalog

Definition

Profile catalog (Sasuser.Profile)

  • is a catalog that is available for customizing the way you work with SAS. SAS uses this catalog to store function key definitions, fonts for graphics applications, window attributes, and other information from interactive windowing procedures.

How the Information Is Used

The information in the Sasuser.Profile catalog is accessed automatically by SAS when you need it for processing. For example, each time you enter the KEYS window and change the settings, SAS stores the new settings with the KEYS entry type. Similarly, if you change and save the attributes for interactive window procedures, the changes are stored under the appropriate entry name and type. When you use the window or procedure, SAS then looks for information in the Profile catalog.

How Sasuser.Profile Is Created

SAS creates the Profile catalog the first time it tries to refer to it and discovers that it does not exist. If you are using an interactive windowing environment, this occurs during system initialization in your first SAS session. If you use one of the other modes of execution, the Profile catalog is created the first time you execute a SAS procedure that requires it.

Operating Environment Information: The Sasuser library is implemented differently in various operating environments. See the SAS documentation for your host system for more information about how the SAS user library is created.

Default Settings

The default settings for your SAS session are stored in several catalogs in the Sashelp installation library. If you do not make any changes to key settings or other options, SAS uses the default settings. If you make changes, the new information is stored in your Profile catalog. To restore the original default settings, use the CATALOG procedure or the CATALOG window to delete the appropriate entries from your Profile catalog. By default, SAS then uses the corresponding entry from the Sashelp library.

During SAS sessions, you can make customizations, such as window resizing and positioning, and save them to Sasuser.Profile. If your Profile catalog is locked or corrupted, the customizations will be saved in Work.Profile instead of in Sasuser.Profile. The following notes will appear in the SAS log:

NOTE: Unable to open SASUSER.PROFILE. WORK.PROFILE will be opened instead. 
NOTE: All profile changes will be lost at the end of the session.

The notes will appear at invocation and again the first time the SAS session writes a member to the WORK.PROFILE catalog.



Catalog Concatenation

Definitions

You can logically combine two or more SAS catalogs by concatenating them. This allows you to access the contents of several catalogs, using one catalog name . There are two types of concatenation, explicit and implicit .

Implicit catalog concatenation

  • results from a concatenation of libraries through a LIBNAME statement. When two or more libraries are logically combined through concatenation, any catalogs with the same name in each library become logically combined as well.

Explicit catalog concatenation

  • is a concatenation that is specified by the global CATNAME statement in which the catalogs to be concatenated are specifically (or explicitly) named. During explicit catalog concatenation, the CATNAME statement sets up a logical catalog in memory.

Example 1: Implicit Concatenation

This LIBNAME statement concatenates the two SAS data libraries:

libname both ('

SAS-data-library 1

''

SAS-data-library 2

');

Members of library1

Members of library2

MYCAT.CATALOG

MYCAT.CATALOG

TABLE1.DATA

MYCAT2.CATALOG

TABLE3.DATA

TABLE1.DATA

 

TABLE1.INDEX

 

TABLE2.DATA

 

TABLE2.INDEX

The concatenated libref BOTH would have the following:

Concatenated libref BOTH

MYCAT.CATALOG (from path 1 and 2)

MYCAT2.CATALOG (from path 2)

TABLE1.DATA (from path 1)

TABLE2.DATA (from path 2)

TABLE2.INDEX (from path 2)

TABLE3.DATA (from path 1)

Notice that TABLE1.INDEX does not appear in the concatenation but TABLE2.INDEX does appear. SAS suppresses listing the index when its associated data file is not part of the concatenation.

So what happened to the catalogs when the libraries were concatenated? A resulting catalog now exists logically in memory, with the full name BOTH.MYCAT.CATALOG. This catalog combines each of the two physical catalogs residing in 'library 1' and 'library2', called MYCAT.CATALOG.

To understand the contents of the concatenation BOTH.MYCAT, first look at the contents of both parts of the concatenation. Assume that the two original MYCAT.CATALOG files contain the following:

Contents of MYCAT.CATALOG in library1

Contents of MYCAT.CATALOG in library 2

A.FRAME

A.GRSEG

C.FRAME

B.FRAME

 

C.FRAME

Then the combined catalog BOTH.MYCAT contains the following:

BOTH.MYCAT

A.GRSEG (from path 2)

A.FRAME (from path 1)

B.FRAME (from path 2)

C.FRAME (from path 1)

Example 2: Explicit Concatenation

The syntax of the CATNAME statement is:

CATNAME libref.catref 
          (libref-1.catalog-1 (ACCESS=READONLY) 
           libref-n.catalog-n (ACCESS=READONLY));

To disassociate a concatenated catalog the syntax is:

CATNAME libref.catref  _ALL_ clear;

In the following example, there must be a libref that is defined and named CATDOG. The libref CATDOG establishes the scope for the explicit concatenation definition.

Note: If a file in CATDOG named COMBINED.CATALOG already exists, it becomes inaccessible until the explicit concatenation CATDOG.COMBINED is cleared.

Members of library1

Members of library2

MYCAT.CATALOG

MYDOG.CATALOG

TABLE1.DATA

MYCAT2.CATALOG

TABLE3.DATA

TABLE1.DATA

 

TABLE1.INDEX

 

TABLE2.DATA

 

TABLE2.INDEX

If we issue the following statement,

CATNAME catdog.combined 
          (library1.mycat (ACCESS=READONLY) 
           library2.mydog (ACCESS=READONLY));

then the concatenated catalog CATDOG.COMBINED combines the following catalogs:

Concatenated catalog CATALOG.COMBINED

MYCAT.CATALOG (from library 1)

MYDOG.CATALOG (from library 2)

Note: In explicit concatenation only the named catalogs are combined. In implicit concatenation, any catalogs that have the same name in their respective libraries are concatenated when those libraries are concatenated.

The previous CATNAME statement creates a catalog that exists logically in memory. This catalog, named CATDOG.COMBINED.CATALOG, combines the two physical catalogs residing in library1 and library2, called MYCAT.CATALOG and MYDOG.CATALOG respectively.

To understand the contents of the concatenation COMBINED.CATALOG, first look at the contents of both parts of the concatenation. The two original catalog files contain the following entries:

MYCAT.CATALOG

library 1

MYDOG.CATALOG

library 2

A.FRAME

A.GRSEG

C.FRAME

B.FRAME

 

C.FRAME

The concatenated catalog COMBINED contains:

COMBINED.CATALOG contents

A.GRSEG (from MYDOG)

A.FRAME (from MYCAT)

B.FRAME (from MYDOG)

C.FRAME (from MYCAT)

Rules for Catalog Concatenation

The rules for catalog concatenation are the same, whether the catalogs are implicitly or explicitly concatenated.

  • When a catalog entry is open for input or update, the parts are searched and the first occurrence of the specified entry is used.

  • When an item is open for output, it will be created in the catalog that is listed first in the concatenation.

    Note: A new catalog entry is created in the first catalog even if there is an item with the same name in another part of the concatenation.

    Note: If the first catalog in a concatenation that is opened for update does not exist, the item will be written to the next catalog that exists in the concatenation.

  • When you want to delete or rename a catalog entry, only the first occurrence of the entry is affected.

  • Any time a list of catalog entries is displayed, only one occurrence of the catalog entry is shown.

    Note: Even if a catalog entry occurs multiple times in the concatenation, only the first occurrence is shown.


SAS 9.1 Language Reference. Concepts
Authors: SAS Institute
Published year: 2004
Pages: 178-179/255
Buy this book on amazon.com >>