SUPPORT / SAMPLES & SAS NOTES
 

Support

Usage Note 47100: Support for user-defined formats in SAS® Visual Analytics 7.51 and earlier

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. In general, you can use your custom formats in SAS Visual Analytics explorations and reports. This SAS Note reviews the following topics:

Note: This SAS Note assumes that you know how to create a format catalog and how to apply formats to your data. For information about these tasks, see Additional resources.

Note: For information about user-defined formats in SAS® Viya®, see "Managing User-Defined Formats on the SAS Viya Platform" in the Data Administration section of the SAS® Viya® Platform Administration guide. For a link to the documentation, see the SAS Viya Platform documentation page.

Making user-defined formats available for interactively loaded tables

There are two main steps to making existing user-defined formats available for use in SAS Visual Analytics 7.51 and earlier:

  1. Store a copy of the format catalog in a file location that is accessible to the SAS® Application Server that is being used by SAS Visual Analytics.

    Tip: If you are using the default SAS Application Server (named SASApp) and your catalog is named formats.sas7bcat, then simply place a copy of formats.sas7bcat in SAS-config-dir/Lev1/SASApp/SASEnvironment/SASFormats and restart your object spawner.

  2. Load the data sets into the SAS® LASR™ Analytic Server.

     

Advanced steps

By default, the application server is SASApp, but you might have created another application server for use by SAS Visual Analytics. In that case, place the catalog in the appropriate directory for the server that you are using. For example, if you are using a server named SASAppVA, then the likely location for the catalog is SAS-config-dir/Lev1/SASAppVA/SASEnvironment/SASFormats. If SAS Visual Analytics uses multiple application servers, place a copy of the catalog in each location.

Your format catalog does not have to be named formats.sas7bcat, and it does not have to be stored in the default location. You can also have multiple format catalogs. For information about these tasks and more, see SAS Note 40103.

Making formats available for autoloaded tables

To make user-defined formats available during autoload, see "User-Defined Formats for Autoload" in the SAS Visual Analytics Administration Guide.

How SAS Visual Analytics Designer supports formats

In SAS Visual Analytics Designer, the Format property of the data item displays the name of the format for both numeric and character data items. However, there are some differences between numeric and character data items.

Numeric data items

  • You can change the format. If you change the format, you can restore the user-defined format by selecting Reset to Default in the Format box.
  • You can specify to sort by formatted or unformatted values.
  • Numeric data items with a user-defined format are classified as categories. You cannot change these data items to measures while the user-defined format is applied.

Character data items

  • You cannot change the format.
  • You cannot specify a sort preference. Sorting is always done on the formatted values.

Tip: Reports created before the formats were applied to the LASR table do not automatically update to show the formats. If the format changed a text string to another text string or a numeric value to another numeric value, then you can click the Refresh icon on the Data tab to see the formats. This assumes that you have updated the metadata for the input table and reloaded the table to LASR. Refreshing does not work for formats that change numeric values to character values. You must either re-create the report, or use the custom category feature.

How SAS Visual Data Builder supports formats

In SAS Visual Data Builder, the Format property displays the name of the applied user-defined format. However, if you change the format, then you cannot restore the user-defined format. You must remove the column from the query and add it back. If you want to use the column with and without the format, then add a second copy of the column to the query.

Tip: Existing queries that use LASR tables as input do not automatically pick up new format information. You must remove the affected columns from the query and then add them back.

Interaction with custom sorts

You can create a custom sort so that data items in a table or graph can sort to the top or to the bottom. Category data items, calculated items that are categories, and custom categories support custom sorts. A custom sort takes precedence over both formatted and unformatted user-defined formats.

Support for localized formats

The FORMAT procedure includes a LOCALE option that can be used to create locale-specific formats. However, these localized formats are not supported by the SAS LASR Analytic Server. For this reason, they are not honored in SAS Visual Analytics.

Limitations on picture formats

No release of SAS Visual Analytics supports picture formats that are created using any of the directives available for the DATATYPE option in the PICTURE statement. For more information, see SAS Note 56402.

Additional resources



Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemSAS Visual Analytics (on SAS 9.x)Linux for x647.59.4 TS1M6
Microsoft® Windows® for x647.59.4 TS1M6
* 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.