SAS Institute. The Power to Know

SAS(R) 9.2 Language Reference: Dictionary

space
Previous Page | Next Page

Formats

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): User's Guide. A listing of national language formats is provided in Formats Documented in Other SAS Publications.

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 on creating and storing user-defined formats, see The 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.

Categories and Descriptions of Formats
Category Formats Description
Character $ASCIIw. Format
Converts native format character data to ASCII representation.

$BASE64Xw. Format
Converts character data into ASCII text by using Base 64 encoding.

$BINARYw. Format
Converts character data to binary representation.

$CHARw. Format
Writes standard character data.

$EBCDICw. Format
Converts native format character data to EBCDIC representation.

$HEXw. Format
Converts character data to hexadecimal representation.

$MSGCASEw. Format
Writes character data in uppercase when the MSGCASE system option is in effect.

$OCTALw. Format
Converts character data to octal representation.

$QUOTEw. Format
Writes data values that are enclosed in double quotation marks.

$REVERJw. Format
Writes character data in reverse order and preserves blanks.

$REVERSw. Format
Writes character data in reverse order and left aligns

$UPCASEw. Format
Converts character data to uppercase.

$VARYINGw. Format
Writes character data of varying length.

$w. Format
Writes standard character data.
Date and Time $N8601Bw.d Format
Writes ISO 8601 duration, datetime, and interval forms using the basic notations PnYnMnDTnH nMnS and yyyymmddThhmmss.

$N8601BAw.d Format
Writes ISO 8601 duration, datetime, and interval forms using the basic notations PyyyymmddThhmmss and yyyymmdd Thhmmss.

$N8601Ew.d Format
Writes ISO 8601 duration, datetime, and interval forms using the extended notations PnYnMnDTn HnMnS and yyyy-mm-ddT hh:mm:ss.

$N8601EAw.d Format
Writes ISO 8601 duration, datetime, and interval forms using the extended notations Pyyyy-mm-ddThh:mm:ss and yyyy-mm-ddThh:mm:ss.

$N8601EHw.d Format
Writes ISO 8601 duration, datetime, and interval forms using the extended notations Pyyyy-mm-ddThh:mm:ss and yyyy-mm-ddThh:mm:ss, using a hyphen ( - ) for omitted components.

$N8601EXw.d Format
Writes ISO 8601 duration, datetime, and interval forms using the extended notations Pyyyy-mm-ddThh:mm:ss and yyyy-mm-ddThh:mm:ss, using an x for digit of an omitted component.

$N8601Hw.d Format
Writes ISO 8601 duration, datetime, and interval forms P nYnMnDTnHnM nS and yyyy-mm-ddThh:mm:ss, dropping omitted components in duration values and using a hyphen ( - ) for omitted components in datetime values.

$N8601Xw.d Format
Writes ISO 8601 duration, datetime, and interval forms P nYnMnDTnHnM nS 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. Format
Writes date values using the IOS 8601 base notation yyyymmdd .

B8601DNw. Format
Writes the date from a datetime value using the ISO 8601 basic notation yyyymmdd.

B8601DTw.d Format
Writes datetime values in the ISO 8601 basic notation yyyymmdd Thhmmssffffff.

B8601DZw. Format
Writes datetime values in the Coordinated Universal Time (UTC) time scale using ISO 8601 datetime and time zone basic notation yyyymmdd Thhmmss+|-hhmm.

B8601LZw. Format
Writes 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 Format
Writes time values using the ISO 8601 basic notation hhmmssffff .

B8601TZw. Format
Adjusts time values to the Coordinated Universal Time (UTC) and writes them using the ISO 8601 basic time notation hhmmss+|- hhmm.

DATEw. Format
Writes date values in the form ddmmmyy, ddmmmyyyy , or dd-mmm-yyyy.

DATEAMPMw.d Format
Writes datetime values in the form ddmmmyy:hh:mm:ss.ss with AM or PM.

DATETIMEw.d Format
Writes datetime values in the form ddmmmyy:hh:mm:ss.ss.

DAYw. Format
Writes date values as the day of the month.

DDMMYYw. Format
Writes 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. Format
Writes 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. Format
Writes date values as the name of the day of the week.

DTDATEw. Format
Expects a datetime value as input and writes date values in the form ddmmmyy or ddmmmyyyy.

DTMONYYw. Format
Writes the date part of a datetime value as the month and year in the form mmmyy or mmmyyyy.

DTWKDATXw. Format
Writes 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. Format
Writes the date part of a datetime value as the year in the form yy or yyyy.

DTYYQCw. Format
Writes the date part of a datetime value as the year and the quarter and separates them with a colon (:).

E8601DAw. Format
Writes date values using the ISO 8601 extended notation yyyy-mm-dd.

E8601DNw. Format
Writes the date from a SAS datetime value using the ISO 8601 extended notation yyyy-mm-dd.

E8601DTw.d Format
Writes datetime values in the ISO 8601 extended notation yyyy-mm-ddThh:mm:ss.ffffff.

E8601DZw. Format
Writes datetime values in the Coordinated Universal Time (UTC) time scale using ISO 8601 datetime and time zone extended notations yyyy-mm-ddThh:mm:ss+|-hh:mm.

E8601LZw. Format
Writes 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 Format
Writes time values using the ISO 8601 extended notation hh:mm:ss.ffffff.

E8601TZw.d Format
Adjusts time values to the Coordinated Universal Time (UTC) and writes them using the ISO 8601 extended notation hh:mm :ss+|-hh:mm.

HHMMw.d Format
Writes time values as hours and minutes in the form hh:mm .

HOURw.d Format
Writes time values as hours and decimal fractions of hours.

JULDAYw. Format
Writes date values as the Julian day of the year.

JULIANw. Format
Writes date values as Julian dates in the form yyddd or yyyyddd.

MMDDYYw. Format
Writes 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. Format
Writes date values in the form mmdd<yy> yy or mm-dd-<yy>yy , where the x in the format name is a character which represents the special character that 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 Format
Writes time values as the number of minutes and seconds since midnight.

MMYYw. Format
Writes date values in the form mmM<yy> yy, where M is the separator and the year appears as either 2 or 4 digits.

MMYYxw. Format
Writes 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. Format
Writes date values as the name of the month.

MONTHw. Format
Writes date values as the month of the year.

MONYYw. Format
Writes date values as the month and the year in the form mmmyy or mmmyyyy.

PDJULGw. Format
Writes packed Julian date values in the hexadecimal format