SUPPORT / SAMPLES & SAS NOTES
 

Support

Usage Note 40103: Frequently asked questions about making user-defined formats available in a SAS® Business Intelligence deployment

DetailsAboutRate It

Overview

SAS enables you to create user-defined formats that execute instructions for displaying data values. For example, you might create a format that spells out an abbreviation, or that changes a numeric code to a more easily understood character string. To make existing user-defined formats available for use in clients such as SAS® Visual Analytics, SAS® Information Map Studio, and SAS® Data Integration Studio, you store a copy of your format catalog in a file location that is accessible to the SAS® Application Server that is being used by those applications.

For example, if you are using the default SAS Application Server (named SASApp) and your catalog is named formats.sas7bcat, then you simply place a copy of formats.sas7bcat in SAS-config-dir/Lev1/SASApp/SASEnvironment/SASFormats.

This note contains the following topics:

Note: For more information about SAS system options, how to create a format catalog, how to apply formats to your data, and managing format catalogs on multiple machines, see Additional resources.

About the Configuration Files

There are two related configuration files for the workspace server: sasv9.cfg and sasv9_usermods.cfg. If you are using the default SAS Application Server, these files are located in a directory such as <sas-config-dir>/Lev1/SASApp/.

In the initial configuration, the sasv9.cfg file includes the following lines:

-set APFMTLIB "SASEnvironment/SASFormats"
-insert fmtsearch APFMTLIB

The SET system option assigns the default libref (APFMTLIB) and the relative path to the storage location (SASEnvironment/SASFormats) for the format catalogs. The FMTSEARCH system option specifies to search for the format catalog in the location identified by SET system option. Since the FMTSEARCH option does not specify a catalog name, SAS assumes the catalog in APFMTLIB is named formats.sas7bcat.

Do not make changes directly to the sasv9.cfg file. Instead, as explained in this note, use the sasv9_usermods.cfg file to override the default settings.

Specifying a Format Catalog with a Different Name in the Default Location

If the catalog that you are storing in the default location is not named formats, then you can easily specify a different catalog name. For example, suppose that your catalog is named usrfmt. Here are the steps to point to usrfmt:

  1. Locate the sasv9_usermods.cfg file for the workspace server, and open the file in a plain text editor.
  2. Add the following line to point to the preferred catalog:
-insert fmtsearch APFMTLIB.usrfmt
  1. Save the file.
  2. Restart the object spawner.

Note: If SAS is running on a UNIX server, you must enter your libref using uppercase letters. For example, APFMTLIB must be all uppercase.

Referencing Additional Format Catalogs in the Default Location

Your default location can contain catalogs in addition to the one named formats. For example, suppose that your default location also contains catalogs named format2 and format3. Here are the steps to reference those catalogs:

  1. Place a copy of each catalog in the directory identified by the SET option in the sasv9.cfg file.
  2. Locate the sasv9_usermods.cfg file for the workspace server, and open the file in a plain text editor.
  3. Add the following line to point to your other format catalogs:
-insert fmtsearch (APFMTLIB.format2 APFMTLIB.format3)
  1. Save the file.
  2. Restart the object spawner.

Note: If SAS is running on a UNIX server, you must enter your libref using uppercase letters. For example, APFMTLIB must be all uppercase.

Specifying Additional Catalog Locations

You can specify format locations in addition to the default location. For example, suppose that you also store format catalogs in C:\SAS\Config\Lev1\SASApp\MoreFormats. Here are the steps to point to catalogs in that additional location:

  1. Locate the sasv9_usermods.cfg file for the workspace server, and open the file in a plain text editor.
  2. Add the following lines. Use the SET system option to provide the libref and the fully qualified path to the additional catalog location. Use the FMTSEARCH option to point to both the default location (APFMTLIB) and the new location. In this example, the new libref is FMTLOC2.
-set FMTLOC2 "C:\SAS\Config\Lev1\SASApp\MoreFormats"
-insert fmtsearch (APFMTLIB FMTLOC2)
  1. (Conditional) If the catalog in the new location is not named formats, then append the name of the catalog to the libref. For example, if your catalog in FMTLOC2 is named usrfmt, then enter:
-set FMTLOC2 "C:\SAS\Config\Lev1\SASApp\MoreFormats"
-insert fmtsearch (APFMTLIB FMTLOC2.usrfmt)
  1. Save the file.
  2. Restart the object spawner.

Note: If SAS is running on a UNIX server, you must enter your libref using uppercase letters. For example, APFMTLIB and FMTLOC2 must be all uppercase.

Changing the Default Format Catalog Location

You do not have to store your catalogs in the location specified by the SET option in the sasv9.cfg file, as long as the new location is still accessible to the SAS Application Server used by the clients. For example, suppose that your catalogs are stored in C:\SAS\Config\Lev1\SASApp\MoreFormats. Here are the steps to use the same default libref (APFMTLIB) but point to your preferred location instead of the default location:

  1. Locate the sasv9_usermods.cfg file for the workspace server, and open the file in a plain text editor.
  2. Add the following lines. For the SET system option, specify the default libref (APFMTLIB) and the fully qualified path to the preferred catalog location. Include the FMTSEARCH option to point to APFMTLIB.
-set APFMTLIB "C:\SAS\Config\Lev1\SASApp\MoreFormats"
-insert fmtsearch APFMTLIB
  1. (Conditional) If the catalog in the new location is not named formats, then append the name of the catalog to the libref. For example, if your catalog in APFMTLIB is named usrfmt, then enter:
-set APFMTLIB "C:\SAS\Config\Lev1\SASApp\MoreFormats"
-insert fmtsearch APFMTLIB.usrfmt

If you have more than one catalog in the new location, then use this form:

-set APFMTLIB "C:\SAS\Config\Lev1\SASApp\MoreFormats"
-insert fmtsearch (APFMTLIB.usrfmt APFMTLIB.usrfmt2)
  1. Save the file.
  2. Restart the object spawner.

Note: If SAS is running on a UNIX server, you must enter your libref using uppercase letters. For example, APFMTLIB must be all uppercase.

Referencing a User-Defined Format Configuration File

Instead of specifying the location of your format catalogs directly in the sasv9_usermods.cfg file, you can point to a .cfg file that contains the location of your catalogs. For example, suppose that you have a format catalog named newcat. The catalog is located in C:\SAS\Config\Lev1\SASApp\MoreFormats. You want to use the libref FMTLOC2. Here are the steps to use a .cfg file to point to that catalog:

  1. Open a new file in a plain text editor, and add the following lines. Use the SET system option to provide the libref and the fully qualified path to the catalog location. Use the FMTSEARCH option to point to the location specified by the SET system option:
-set FMTLOC2 "C:\SAS\Config\Lev1\SASApp\MoreFormats"
-insert fmtsearch (FMTLOC2.newcat)
  1. Save the file with a .cfg extension. For example, you might name it fmtfile.cfg.
  2. Locate the sasv9_usermods.cfg file for the workspace server, and open the file in a plain text editor.
  3. Add the following line to point to the .cfg file.
-config "C:\SAS\Config\Lev1\SASApp\MoreFormats\fmtfile.cfg"
Note: On UNIX systems, do not include the quotation marks around the file path.
  1. Save the file.
  2. Restart the object spawner.

Note: If SAS is running on a UNIX server, you must enter your libref using uppercase letters. For example, FMTLOC2 must be all uppercase.

Additional Considerations

  • If you used the LOCALE option in the PROC FORMAT statement when you created the format, then you would add /locale to the FMTSEARCH option. For example, if you created a catalog named multi using the LOCALE option, then you might specify -insert fmtsearch (APFMTLIB.multi /locale).
  • In general, you can use your custom formats in SAS Visual Analytics. For information about support for user-defined formats in SAS Visual Analytics, see SAS Note 47100.

  • User-defined formats are not supported if the library is allocated with the META engine. For more information, see SAS Note 43378.

  • When building cubes in the Cube Designer, you can enter the name of a user-defined format. However, a list of available formats is not presented.

Additional Resources



Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemSAS BI ServerLinux9.2 TS2M0
HP-UX IPF9.2 TS2M0
64-bit Enabled Solaris9.2 TS2M0
64-bit Enabled HP-UX9.2 TS2M0
64-bit Enabled AIX9.2 TS2M0
Windows Vista9.2 TS2M0
Windows Vista for x649.2 TS2M0
Microsoft Windows XP Professional9.2 TS2M0
Microsoft Windows Server 2008 for x649.2 TS2M0
Microsoft Windows Server 2008 R29.2 TS2M0
Microsoft Windows Server 2003 for x649.2 TS2M0
Microsoft Windows Server 2003 Standard Edition9.2 TS2M0
Microsoft Windows Server 2003 Enterprise Edition9.2 TS2M0
Microsoft Windows Server 2003 Datacenter Edition9.2 TS2M0
Microsoft® Windows® for x649.2 TS2M0
Microsoft Windows XP 64-bit Edition9.2 TS2M0
Microsoft Windows Server 2003 Enterprise 64-bit Edition9.2 TS2M0
Microsoft Windows Server 2003 Datacenter 64-bit Edition9.2 TS2M0
z/OS9.2 TS2M0
Microsoft® Windows® for 64-Bit Itanium-based Systems9.2 TS2M0
Linux for x649.2 TS2M0
Solaris for x649.2 TS2M0
SAS SystemSAS Enterprise BI ServerSolaris for x649.2 TS2M0
Linux for x649.2 TS2M0
Linux9.2 TS2M0
HP-UX IPF9.2 TS2M0
64-bit Enabled Solaris9.2 TS2M0
64-bit Enabled HP-UX9.2 TS2M0
64-bit Enabled AIX9.2 TS2M0
Windows Vista for x649.2 TS2M0
Windows Vista9.2 TS2M0
Microsoft Windows XP Professional9.2 TS2M0
Microsoft Windows Server 2008 for x649.2 TS2M0
Microsoft Windows Server 2008 R29.2 TS2M0
Microsoft Windows Server 2003 for x649.2 TS2M0
Microsoft Windows Server 2003 Standard Edition9.2 TS2M0
Microsoft Windows Server 2003 Enterprise Edition9.2 TS2M0
Microsoft Windows Server 2003 Datacenter Edition9.2 TS2M0
Microsoft® Windows® for x649.2 TS2M0
Microsoft Windows XP 64-bit Edition9.2 TS2M0
Microsoft Windows Server 2003 Enterprise 64-bit Edition9.2 TS2M0
Microsoft Windows Server 2003 Datacenter 64-bit Edition9.2 TS2M0
Microsoft® Windows® for 64-Bit Itanium-based Systems9.2 TS2M0
z/OS9.2 TS2M0
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.