FMTINFO Function

Retrieves information about a format or informat.

Category:Special
Restrictions:CAS
This function returns information about formats that are supplied by SAS. It cannot be used for user-defined formats that are created with the FORMAT procedure.

Syntax

FMTINFO(fmtname, info)

Required Arguments

fmtname

specifies the format or informat name.

info

specifies the category, type, or description of the format or informat.

Note: You can specify only one info argument in your code.

CAT

specifies the category:

  • BIDI Text Handling
  • Character
  • Currency Conversion
  • Date and Time
  • DBCS
  • Hebrew Text Handling
  • ISO 8601
  • Numeric

TYPE

specifies the type of language element:

  • informat
  • format
  • both

DESC

specifies a short description of the format or informat.

MIND

specifies the minimum decimal value of the format or informat.

MAXD

specifies the maximum decimal value of the format or informat.

DEFD

specifies the default decimal value of the format or informat.

MINW

specifies the minimum width value of the format or informat.

MAXW

specifies the maximum width value of the format or informat.

DEFW

specifies the default width value of the format or informat.

Details

The FMTINFO function retrieves information about a format or informat. You can retrieve information about a format or informat’s category, the type of language element (format, informat, or both), a description of the language element, and the minimum, maximum, and default decimal and width values.

You cannot specify multiple arguments with the FMTINFO function. You can specify only one of these arguments: CAT, TYPE, DESC, MIND, MAXD, DEFD, MINW, MAXW, and DEFW. For example,

a=fmtinfo('best',cat);

is valid because you specify only one argument, the category argument cat.

You must enclose the arguments with apostrophes unless you are passing a character variable name.

The FMTINFO function returns a character string for all data values, including these numeric value arguments: MIND, MAXD, DEFD, MINW, MAXW, and DEFW.

Do not include a length value when specifying a format or informat. For example, the Date format should include only the name of the format: a=fmtinfo('date', 'type');

Example

The following examples retrieve information about the BEST format.

data one;                                                                                                                               
   a=fmtinfo('best','cat');
   put a=;
   b=fmtinfo('best','type');
   put b=; 
   c=fmtinfo('best','desc');
   put c=;
run; 

These statements produce these results:

a=num
b=BOTH
c=SAS System chooses best notation
Last updated: September 14, 2026