Formats by Category

There are four categories of formats in this list:
Category
Description
Character
instructs SAS to write character data values from character variables.
Date and Time
instructs SAS to write data values from variables that represent dates, times, and datetimes.
ISO 8601
instructs SAS to write date, time, and datetime values using the ISO 8601 standard.
Numeric
instructs SAS to write numeric data values from numeric variables.
Formats that support national languages can be found in SAS National Language Support (NLS): Reference Guide.
Storing user-defined formats is an important consideration if you associate these formats with variables in permanent SAS data sets, especially those data sets shared with other users.For information about creating and storing user-defined formats, see FORMAT Procedure in Base SAS Procedures Guide.
The following table provides brief descriptions of the SAS formats. For more detailed descriptions, see the dictionary entry for each format.
Category Language Elements Description
Character$ASCIIw. FormatConverts native format character data to ASCII representation.
$BASE64Xw. FormatConverts character data into ASCII text by using Base 64 encoding.
$BINARYw. FormatConverts character data to binary representation.
$CHARw. FormatWrites standard character data.
$EBCDICw. FormatConverts native format character data to EBCDIC representation.
$HEXw. FormatConverts character data to hexadecimal representation.
$MSGCASEw. FormatWrites character data in uppercase when the MSGCASE system option is in effect.
$OCTALw. FormatConverts character data to octal representation.
$QUOTEw. FormatWrites data values that are enclosed in double quotation marks.
$REVERJw. FormatWrites character data in reverse order and preserves blanks.
$REVERSw. FormatWrites character data in reverse order and left aligns
$UPCASEw. FormatConverts character data to uppercase.
$VARYINGw. FormatWrites character data of varying length.
$w. FormatWrites standard character data.
Date and Time$N8601Bw.d FormatWrites ISO 8601 duration, datetime, and interval forms by using the basic notations PnYnMnDTnHnMnS and yyyymmddThhmmss.
$N8601BAw.d FormatWrites ISO 8601 duration, datetime, and interval forms by using the basic notations PyyyymmddThhmmss and yyyymmddThhmmss.
$N8601Ew.d FormatWrites ISO 8601 duration, datetime, and interval forms by using the extended notations PnYnMnDTnHnMnS and yyyy-mm-ddThh:mm:ss.
$N8601EAw.d FormatWrites ISO 8601 duration, datetime, and interval forms by using the extended notations Pyyyy-mm-ddThh:mm:ss and yyyy-mm-ddThh:mm:ss.
$N8601EHw.d FormatWrites ISO 8601 duration, datetime, and interval forms by using the extended notations Pyyyy-mm-ddThh:mm:ss and yyyy-mm-ddThh:mm:ss, using a hyphen ( - ) for omitted components.
$N8601EXw.d FormatWrites ISO 8601 duration, datetime, and interval forms by using the extended notations Pyyyy-mm-ddThh:mm:ss and yyyy-mm-ddThh:mm:ss, using an x for each digit of an omitted component.
$N8601Hw.d FormatWrites ISO 8601 duration, datetime, and interval forms PnYnMnDTnHnMnS and yyyy-mm-ddThh:mm:ss, dropping omitted components in duration values and using a hyphen ( - ) for omitted components in datetime values.
$N8601Xw.d FormatWrites ISO 8601 duration, datetime, and interval forms PnYnMnDTnHnMnS and yyyy-mm-ddThh:mm:ss, dropping omitted components in duration values and using an x for each digit of an omitted component in datetime values.
B8601DAw. FormatWrites date values by using the ISO 8601 basic notation yyyymmdd.
B8601DNw. FormatWrites dates from datetime values by using the ISO 8601 basic notation yyyymmdd.
B8601DTw.d FormatWrites datetime values by using the ISO 8601 basic notation yyyymmddThhmmss<ffffff>.
B8601DZw. FormatWrites datetime values for the zero meridian Coordinated Universal Time (UTC) time by using the ISO 8601 datetime and time zone basic notation yyyymmddThhmmss+0000.
B8601LZw. FormatWrites time values as local time by appending a time zone offset difference between the local time and UTC, using the ISO 8601 basic time notation hhmmss+|–hhmm.
B8601TMw.d FormatWrites time values by using the ISO 8601 basic notation hhmmss<ffff>.
B8601TZw. FormatAdjusts time values to the Coordinated Universal Time (UTC) and writes the time values by using the ISO 8601 basic time notation hhmmss+|–hhmm.
DATEw. FormatWrites date values in the form ddmmmyy, ddmmmyyyy, or dd-mmm-yyyy.
DATEAMPMw.d FormatWrites datetime values in the form ddmmmyy:hh:mm:ss.ss with AM or PM.
DATETIMEw.d FormatWrites datetime values in the form ddmmmyy:hh:mm:ss.ss.
DAYw. FormatWrites date values as the day of the month.
DDMMYYw. FormatWrites date values in the form ddmm<yy>yy or dd/mm/<yy>yy, where a forward slash is the separator and the year appears as either 2 or 4 digits.
DDMMYYxw. FormatWrites date values in the form ddmm<yy>yy or dd-mm-yy<yy>, where the x in the format name is a character that represents the special character that separates the day, month, and year, which can be a hyphen (-), period (.), blank character, slash (/), colon (:), or no separator; the year can be either 2 or 4 digits.
DOWNAMEw. FormatWrites date values as the name of the day of the week.
DTDATEw. FormatExpects a datetime value as input and writes date values in the form ddmmmyy or ddmmmyyyy.
DTMONYYw. FormatWrites the date part of a datetime value as the month and year in the form mmmyy or mmmyyyy.
DTWKDATXw. FormatWrites the date part of a datetime value as the day of the week and the date in the form day-of-week, dd month-name yy (or yyyy).
DTYEARw. FormatWrites the date part of a datetime value as the year in the form yy or yyyy.
DTYYQCw. FormatWrites the date part of a datetime value as the year and the quarter and separates them with a colon (:).
E8601DAw. FormatWrites date values by using the ISO 8601 extended notation yyyy-mm-dd.
E8601DNw. FormatWrites dates from SAS datetime values by using the ISO 8601 extended notation yyyy-mm-dd.
E8601DTw.d FormatWrites datetime values by using the ISO 8601 extended notation yyyy-mm-ddThh:mm:ss.ffffff.
E8601DZw. FormatWrites datetime values for the zero meridian Coordinated Universal Time (UTC) time by using the ISO 8601 datetime and time zone extended notation yyyy-mm-ddThh:mm:ss+00:00.
E8601LZw. FormatWrites time values as local time, appending the Coordinated Universal Time (UTC) offset for the local SAS session, using the ISO 8601 extended time notation hh:mm:ss+|–hh:mm.
E8601TMw.d FormatWrites time values by using the ISO 8601 extended notation hh:mm:ss.ffffff.
E8601TZw.d FormatAdjusts time values to the Coordinated Universal Time (UTC) and writes the time values by using the ISO 8601 extended notation hh:mm:ss+|–hh:mm.
HHMMw.d FormatWrites time values as hours and minutes in the form hh:mm.
HOURw.d FormatWrites time values as hours and decimal fractions of hours.
JULDAYw. FormatWrites date values as the Julian day of the year.
JULIANw. FormatWrites date values as Julian dates in the form yyddd or yyyyddd.
MDYAMPMw.d FormatWrites datetime values in the form mm/dd/yy<yy> hh:mm AM|PM. The year can be either two or four digits.
MMDDYYw. FormatWrites date values in the form mmdd<yy>yy or mm/dd/<yy>yy, where a forward slash is the separator and the year appears as either 2 or 4 digits.
MMDDYYxw. FormatWrites date values in the form mmdd<yy>yy or mm-dd-<yy>yy, where the x in the format name is a character that represents the special character which separates the month, day, and year. The special character can be a hyphen (-), period (.), blank character, slash (/), colon (:), or no separator; the year can be either 2 or 4 digits.
MMSSw.d FormatWrites time values as the number of minutes and seconds since midnight.
MMYYw. FormatWrites date values in the form mmM<yy>yy, where M is the separator and the year appears as either 2 or 4 digits.
MMYYxw. FormatWrites date values in the form mm<yy>yy or mm-<yy>yy, where the x in the format name is a character that represents the special character that separates the month and the year, which can be a hyphen (-), period (.), blank character, slash (/), colon (:), or no separator; the year can be either 2 or 4 digits.
MONNAMEw. FormatWrites date values as the name of the month.
MONTHw. FormatWrites date values as the month of the year.
MONYYw. FormatWrites date values as the month and the year in the form mmmyy or mmmyyyy.
PDJULGw. FormatWrites packed Julian date values in the hexadecimal format yyyydddF for IBM.
PDJULIw. FormatWrites packed Julian date values in the hexadecimal format ccyydddF for IBM.
QTRw. FormatWrites date values as the quarter of the year.
QTRRw. FormatWrites date values as the quarter of the year in Roman numerals.
TIMEw.d FormatWrites time values as hours, minutes, and seconds in the form hh:mm:ss.ss.
TIMEAMPMw.d FormatWrites time and datetime values as hours, minutes, and seconds in the form hh:mm:ss.ss with AM or PM.
TODw.d FormatWrites SAS time values and the time portion of SAS datetime values in the form hh:mm:ss.ss.
WEEKDATEw. FormatWrites date values as the day of the week and the date in the form day-of-week, month-name dd, yy (or yyyy).
WEEKDATXw. FormatWrites date values as the day of the week and date in the form day-of-week, dd month-name yy (or yyyy).
WEEKDAYw. FormatWrites date values as the day of the week.
WEEKUw. FormatWrites a week number in decimal format by using the U algorithm.
WEEKVw. FormatWrites a week number in decimal format by using the V algorithm.
WEEKWw. FormatWrites a week number in decimal format by using the W algorithm.
WORDDATEw. FormatWrites date values as the name of the month, the day, and the year in the form month-name dd, yyyy.
WORDDATXw. FormatWrites date values as the day, the name of the month, and the year in the form dd month-name yyyy.
YEARw. FormatWrites date values as the year.
YYMMw. FormatWrites date values in the form <yy>yyMmm, where M is a character separator to indicate that the month number follows the M and the year appears as either 2 or 4 digits.
YYMMDDw. FormatWrites date values in the form yymmdd or <yy>yy-mm-dd, where a hyphen is the separator and the year appears as either 2 or 4 digits.
YYMMDDxw. FormatWrites date values in the form yymmdd or <yy>yy-mm-dd, where the x in the format name is a character that represents the special character which separates the year, month, and day. The special character can be a hyphen (-), period (.), blank character, slash (/), colon (:), or no separator; the year can be either 2 or 4 digits.
YYMONw. FormatWrites date values in the form yymmm or yyyymmm.
YYQw. FormatWrites date values in the form <yy>yyQq, where Q is the separator, the year appears as either 2 or 4 digits, and q is the quarter of the year.
YYQxw. FormatWrites date values in the form <yy>yyq or <yy>yy-q, where the x in the format name is a character that represents the special character that separates the year and the quarter or the year, which can be a hyphen (-), period (.), blank character, slash (/), colon (:), or no separator; the year can be either 2 or 4 digits.
YYQRw. FormatWrites date values in the form <yy>yyQqr, where Q is the separator, the year appears as either 2 or 4 digits, and qr is the quarter of the year expressed in roman numerals.
YYQRxw. FormatWrites date values in the form <yy>yyqr or <yy>yy-qr, where the x in the format name is a character that represents the special character that separates the year and the quarter or the year, which can be a hyphen (-), period (.), blank character, slash (/), colon (:), or no separator; the year can be either 2 or 4 digits and qr is the quarter of the year expressed in roman numerals.
ISO 8601$N8601Bw.d FormatWrites ISO 8601 duration, datetime, and interval forms by using the basic notations PnYnMnDTnHnMnS and yyyymmddThhmmss.
$N8601BAw.d FormatWrites ISO 8601 duration, datetime, and interval forms by using the basic notations PyyyymmddThhmmss and yyyymmddThhmmss.
$N8601Ew.d FormatWrites ISO 8601 duration, datetime, and interval forms by using the extended notations PnYnMnDTnHnMnS and yyyy-mm-ddThh:mm:ss.
$N8601EAw.d FormatWrites ISO 8601 duration, datetime, and interval forms by using the extended notations Pyyyy-mm-ddThh:mm:ss and yyyy-mm-ddThh:mm:ss.
$N8601EHw.d FormatWrites ISO 8601 duration, datetime, and interval forms by using the extended notations Pyyyy-mm-ddThh:mm:ss and yyyy-mm-ddThh:mm:ss, using a hyphen ( - ) for omitted components.
$N8601EXw.d FormatWrites ISO 8601 duration, datetime, and interval forms by using the extended notations Pyyyy-mm-ddThh:mm:ss and yyyy-mm-ddThh:mm:ss, using an x for each digit of an omitted component.
$N8601Hw.d FormatWrites ISO 8601 duration, datetime, and interval forms PnYnMnDTnHnMnS and yyyy-mm-ddThh:mm:ss, dropping omitted components in duration values and using a hyphen ( - ) for omitted components in datetime values.
$N8601Xw.d FormatWrites ISO 8601 duration, datetime, and interval forms PnYnMnDTnHnMnS and yyyy-mm-ddThh:mm:ss, dropping omitted components in duration values and using an x for each digit of an omitted component in datetime values.
B8601DAw. FormatWrites date values by using the ISO 8601 basic notation yyyymmdd.
B8601DNw. FormatWrites dates from datetime values by using the ISO 8601 basic notation yyyymmdd.
B8601DTw.d FormatWrites datetime values by using the ISO 8601 basic notation yyyymmddThhmmss<ffffff>.
B8601DZw. FormatWrites datetime values for the zero meridian Coordinated Universal Time (UTC) time by using the ISO 8601 datetime and time zone basic notation yyyymmddThhmmss+0000.
B8601LZw. FormatWrites time values as local time by appending a time zone offset difference between the local time and UTC, using the ISO 8601 basic time notation hhmmss+|–hhmm.
B8601TMw.d FormatWrites time values by using the ISO 8601 basic notation hhmmss<ffff>.
B8601TZw. FormatAdjusts time values to the Coordinated Universal Time (UTC) and writes the time values by using the ISO 8601 basic time notation hhmmss+|–hhmm.
E8601DAw. FormatWrites date values by using the ISO 8601 extended notation yyyy-mm-dd.
E8601DNw. FormatWrites dates from SAS datetime values by using the ISO 8601 extended notation yyyy-mm-dd.
E8601DTw.d FormatWrites datetime values by using the ISO 8601 extended notation yyyy-mm-ddThh:mm:ss.ffffff.
E8601DZw. FormatWrites datetime values for the zero meridian Coordinated Universal Time (UTC) time by using the ISO 8601 datetime and time zone extended notation yyyy-mm-ddThh:mm:ss+00:00.
E8601LZw. FormatWrites time values as local time, appending the Coordinated Universal Time (UTC) offset for the local SAS session, using the ISO 8601 extended time notation hh:mm:ss+|–hh:mm.
E8601TMw.d FormatWrites time values by using the ISO 8601 extended notation hh:mm:ss.ffffff.
E8601TZw.d FormatAdjusts time values to the Coordinated Universal Time (UTC) and writes the time values by using the ISO 8601 extended notation hh:mm:ss+|–hh:mm.
NumericBESTw. FormatSAS chooses the best notation.
BESTDw.p FormatPrints numeric values, lining up decimal places for values of similar magnitude, and prints integers without decimals.
BINARYw. FormatConverts numeric values to binary representation.
COMMAw.d FormatWrites numeric values with a comma that separates every three digits and a period that separates the decimal fraction.
COMMAXw.d FormatWrites numeric values with a period that separates every three digits and a comma that separates the decimal fraction.
Dw.p FormatPrints numeric values, possibly with a great range of values, lining up decimal places for values of similar magnitude.
DOLLARw.d FormatWrites numeric values with a leading dollar sign, a comma that separates every three digits, and a period that separates the decimal fraction.
DOLLARXw.d FormatWrites numeric values with a leading dollar sign, a period that separates every three digits, and a comma that separates the decimal fraction.
Ew. FormatWrites numeric values in scientific notation.
FLOATw.d FormatGenerates a native single-precision, floating-point value by multiplying a number by 10 raised to the dth power.
FRACTw. FormatConverts numeric values to fractions.
HEXw. FormatConverts real binary (floating-point) values to hexadecimal representation.
IBw.d FormatWrites native integer binary (fixed-point) values, including negative values.
IBRw.d FormatWrites integer binary (fixed-point) values in Intel and DEC formats.
IEEEw.d FormatGenerates an IEEE floating-point value by multiplying a number by 10 raised to the dth power.
NEGPARENw.d FormatWrites negative numeric values in parentheses.
NUMXw.d FormatWrites numeric values with a comma in place of the decimal point.
OCTALw. FormatConverts numeric values to octal representation.
PDw.d FormatWrites data in packed decimal format.
PERCENTw.d FormatWrites numeric values as percentages.
PERCENTNw.d FormatProduces percentages, using a minus sign for negative values.
PIBw.d FormatWrites positive integer binary (fixed-point) values.
PIBRw.d FormatWrites positive integer binary (fixed-point) values in Intel and DEC formats.
PKw.d FormatWrites data in unsigned packed decimal format.
PVALUEw.d FormatWrites p-values.
RBw.d FormatWrites real binary data (floating-point) in real binary format.
ROMANw. FormatWrites numeric values as roman numerals.
S370FFw.d FormatWrites native standard numeric data in IBM mainframe format.
S370FIBw.d FormatWrites integer binary (fixed-point) values, including negative values, in IBM mainframe format.
S370FIBUw.d FormatWrites unsigned integer binary (fixed-point) values in IBM mainframe format.
S370FPDw.d FormatWrites packed decimal data in IBM mainframe format.
S370FPDUw.d FormatWrites unsigned packed decimal data in IBM mainframe format.
S370FPIBw.d FormatWrites positive integer binary (fixed-point) values in IBM mainframe format.
S370FRBw.d FormatWrites real binary (floating-point) data in IBM mainframe format.
S370FZDw.d FormatWrites zoned decimal data in IBM mainframe format.
S370FZDLw.d FormatWrites zoned decimal leading–sign data in IBM mainframe format.
S370FZDSw.d FormatWrites zoned decimal separate leading-sign data in IBM mainframe format.
S370FZDTw.d FormatWrites zoned decimal separate trailing-sign data in IBM mainframe format.
S370FZDUw.d FormatWrites unsigned zoned decimal data in IBM mainframe format.
SSNw. FormatWrites Social Security numbers.
VAXRBw.d FormatWrites real binary (floating-point) data in VMS format.
VMSZNw.d FormatGenerates VMS and MicroFocus COBOL zoned numeric data.
w.d FormatWrites standard numeric data one digit per byte.
WORDFw. FormatWrites numeric values as words with fractions that are shown numerically.
WORDSw. FormatWrites numeric values as words.
Zw.d FormatWrites standard numeric data with leading 0s.
ZDw.d FormatWrites numeric data in zoned decimal format .