Usage Note 30997: Does PROC FORMAT have a limit on the number of unique values that can be defined or the amount of memory I need to load a format?
There is no hard limit for the number of unique values that can be defined with PROC FORMAT, or the amount of memory needed to load a format. A value for the MEMSIZE system option that is too low will result in out-of-memory conditions. To increase the memory limit, you can edit the "-MEMSIZE" value in the SASV9.cfg file. For example:
This sets the memory limit of SAS to 8GB. If you have 32-bit version of SAS, the memory limit is 2GB, and this cannot be increased unless you upgrade to 64-bit SAS.
If memory is exceeded when you try to load a format, you can use the macro available from the Downloads tab to estimate the amount of memory needed to load a format. If you want to know how much memory a format will take before creating the format, create a reduced version of the format, find the amount of memory with the macro, then multiply by the factor that you reduced your format by to get the full format size.
More details about this macro and its use can be found in a paper written by Rick Langston, presented at SAS Global Forum 2009:
Scalability of Table Lookup Techniques.
The program in the file contains the macro and tests for the macro. The CATALOG access method and DATA step is used to calculate the amount of memory required to load a format. Using the CATALOG access method, the format itself is not loaded into memory; only the header record is loaded.
You must be running SAS® 8 or SAS® 9 to use this program because it contains long variable names. However, it will operate on SAS® Version 6 format catalogs in addition to format catalogs created in SAS 8 and SAS 9.
You can choose to permanently save the macro to the AUTOCALL library but you would need to modify the code to do this. The default is to store the macro in your Work library.
If you have not already done so, submit a LIBNAME statement to point to the directory where your format catalog is stored.
After downloading the file from the Downloads tab, open a SAS® session and paste the statements from the file into your SAS session and submit them.
Call the macro and pass in the expected parameter, which is in the form of libref.catalog. In the example below, 'mySAS' is the name of the folder (or directory) and 'formats' is the name of the catalog.
%get_fmt_mem_sizes(mySAS.formats)
Operating System and Release Information
SAS System | N/A | z/OS | 8.2 TS2M0 | |
OpenVMS VAX | 8.2 TS2M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 8.2 TS2M0 | |
OS/2 | 8.2 TS2M0 | |
Microsoft Windows 95/98 | 8.2 TS2M0 | |
Microsoft Windows 2000 Advanced Server | 8.2 TS2M0 | |
Microsoft Windows 2000 Datacenter Server | 8.2 TS2M0 | |
Microsoft Windows 2000 Server | 8.2 TS2M0 | |
Microsoft Windows 2000 Professional | 8.2 TS2M0 | |
Microsoft Windows NT Workstation | 8.2 TS2M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 8.2 TS2M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 8.2 TS2M0 | |
Microsoft Windows Server 2003 Standard Edition | 8.2 TS2M0 | |
Microsoft Windows XP Professional | 8.2 TS2M0 | |
Windows Millennium Edition (Me) | 8.2 TS2M0 | |
64-bit Enabled AIX | 8.2 TS2M0 | |
64-bit Enabled HP-UX | 8.2 TS2M0 | |
64-bit Enabled Solaris | 8.2 TS2M0 | |
ABI+ for Intel Architecture | 8.2 TS2M0 | |
AIX | 8.2 TS2M0 | |
HP-UX | 8.2 TS2M0 | |
HP-UX IPF | 8.2 TS2M0 | |
IRIX | 8.2 TS2M0 | |
Linux | 8.2 TS2M0 | |
Linux on Itanium | 8.2 TS2M0 | |
OpenVMS Alpha | 8.2 TS2M0 | |
Solaris | 8.2 TS2M0 | |
Tru64 UNIX | 8.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.
A STATS data set is written to the Work library. This can be
viewed using SAS Explorer. Select View => Explorer.
Double-click on the STATS data set. You should see an observation
with the amount of memory needed for the entry or entries in the catalog.
If you have a large catalog, you might want to print the data set
or use PROC MEANS to sum the variable.
There is no hard limit for the number of unique values that can be defined with PROC FORMAT, or the amount of memory needed to load a format. The macro available from the
Downloads tab might be useful to estimate the amount of memory that you need.
Date Modified: | 2009-03-23 15:24:15 |
Date Created: | 2008-01-23 14:55:58 |