O'Reilly logo

SAS 9.4 Language Reference, 6th Edition by SAS Institute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

During SAS sessions, you can make customizations, such as window resizing and
positioning, and save them to Sasuser.Profile.
How to Recover Locked or Corrupt Profile Catalogs
Occasionally, a Sasuser.Profile catalog becomes locked or corrupted. SAS uses
Sashelp.Profile and Sasuser.Profbak to replace the locked or corrupted catalog.
If your Sasuser.Profile catalog is locked, SAS checks for Sashelp.Profile. If
Sashelp.Profile exists, SAS copies it to Work.Profile and then saves the customizations
in Work.Profile instead of in Sasuser.Profile. The following notes appear in the SAS log:
ERROR: Expecting page 1, got page -1 instead.
ERROR: Page validation error while reading SASUSER.PROFILE.CATALOG.
NOTE: Unable to open SASUSER.PROFILE. WORK.PROFILE will be opened instead.
NOTE: SASHELP.PROFILE has been copied to WORK.PROFILE.
NOTE: All profile changes will be lost at the end of the session.
If your Sasuser.Profile catalog is corrupted, SAS copies the corrupted catalog to
Sasuser.Badpro. SAS then checks for Sasuser.Profbak. If Sasuser.Profbak exists, SAS
copies it to Sasuser.Profile. Any changes made to the Sasuser.Profile catalog during the
previous session is lost. The following notes appear in the SAS log:
ERROR: Expecting page 1, got page -1 instead.
ERROR: Page validation error while reading SASUSER.PROFILE.CATALOG.
NOTE: A corrupt SASUSER.PROFILE has been detected. A PROFILE catalog can
become corrupt when a SAS session is prematurely terminated.
NOTE: SASUSER.PROFILE.CATALOG has been renamed to SASUSER.BADPRO.CATALOG.
NOTE: SASUSER.PROFILE.CATALOG has been restored from SASUSER.PROFBAK.CATALOG.
NOTE: Changes made to SASUSER.PROFILE.CATALOG during the previous SAS session
have been lost. The type of data stored in the PROFILE catalog is
typically related to SAS session customizations such as key
definitions, fonts for graphics, and window attributes.
If your Sasuser.Profile catalog is corrupted and there is no Sasuser.Profbak, SAS checks
for Sashelp.Profile. If Sashelp.Profile exists, SAS copies it to Work.Profile and then
saves the customizations in Work.Profile instead of in Sasuser.Profile. The following
notes appear in the SAS log:
ERROR: Expecting page 1, got page -1 instead.
ERROR: Page validation error while reading SASUSER.PROFILE.CATALOG.
NOTE: Unable to open SASUSER.PROFILE. WORK.PROFILE will be opened instead.
NOTE: SASHELP.PROFILE has been copied to WORK.PROFILE.
NOTE: All profile changes will be lost at the end of the session.
Catalog Concatenation
Definitions
You can logically combine two or more SAS catalogs by concatenating them. This
enables you to access the contents of several catalogs, using one catalog name. There are
two ways to concatenate catalogs, using the LIBNAME statement and CATNAME
statement.
698 Chapter 30 SAS Catalogs
LIBNAME 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.
CATNAME catalog concatenation
is a concatenation that is specified by the global CATNAME statement in which the
catalogs to be concatenated are specifically named. During CATNAME catalog
concatenation, a logical catalog is set up in memory.
Example 1: LIBNAME Catalog Concatenation
This LIBNAME statement concatenates the two SAS libraries:
libname both ('SAS-library-1' 'SAS-library-2');
Members of Library 1 Members of Library 2
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 library 1 and 2)
MyCat2.CATALOG (from library 2)
Table1.DATA (from library 1)
Table2.DATA (from library 2)
Table2.INDEX (from library 2)
Table3.DATA (from library 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.
Catalog Concatenation 699
This catalog combines each of the two physical catalogs residing in SAS-library-1 and
SAS-library-2, 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 Library 1
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 library 2)
A.FRAME (from library 1)
B.FRAME (from library 2)
C.FRAME (from library 1)
Example 2: CATNAME Catalog 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 CATNAME concatenation definition.
Note: If a file in CatDog named Combined.CATALOG already exists, it becomes
inaccessible until the CATNAME concatenation CatDog.Combined is cleared.
Members of Library 1 Members of Library 2
MyCat.CATALOG MyDog.CATALOG
Table1.DATA MyCat2.CATALOG
Table3.DATA Table1.DATA
700 Chapter 30 SAS Catalogs

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required