Chapter Contents

Previous

Next
SAS Language Reference: Dictionary

Formats by Category

There are four categories of formats in SAS:

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.
DBCS instructs SAS to handle various Asian languages
NUMERIC instructs SAS to write numeric data values from numeric variables.
USER-DEFINED instructs SAS to write data values by using a format that is created with PROC FORMAT.

Storing user-defined formats is an important consideration if you associate these formats with variables in permanent SAS data sets, especially those shared with other users. For information on creating and storing user-defined formats, see the FORMAT procedure in the 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 Format Description
Character $ASCIIw.
Converts native format character data to ASCII representation

$BINARYw.
Converts character data to binary representation

$CHARw.
Writes standard character data

$EBCDICw.
Converts native format character data to EBCDIC representation

$HEXw.
Converts character data to hexadecimal representation

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

$OCTALw.
Converts character data to octal representation

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

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

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

$UPCASEw.
Converts character data to uppercase

$VARYINGw.
Writes character data of varying length

$w.
Writes standard character data
DBCS $KANJIw.
Adds shift-code data to DBCS data

$KANJIXw.
Removes shift code data from DBCS data
Date and Time DATEw.
Writes date values in the form ddmmmyy or ddmmmyyyy

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

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

DAYw.
Writes date values as the day of the month

DDMMYYw.
Writes date values in the form ddmmyy or ddmmyyyy

DDMMYYxw.
Writes date values in the form ddmmyy or ddmmyyyy with a specified separator

DOWNAMEw.
Writes date values as the name of the day of the week

EURDFDDw.
Writes international date values in the form dd.mm.yy or dd.mm.yyyy

EURDFDEw.
Writes international date values in the form ddmmmyy or ddmmmyyyy

EURDFDNw.
Writes international date values as the day of the week

EURDFDTw.d
Writes international datetime values in the form ddmmmyy:hh:mm:ss.ss or ddmmmyyyy hh:mm:ss.ss

EURDFDWNw.
Writes international date values as the name of the day

EURDFMNw.
Writes international date values as the name of the month

EURDFMYw.
Writes international date values in the form mmmyy or mmmyyyy

EURDFWDXw.
Writes international date values as the name of the month, the day, and the year in the form dd month-name yy (or yyyy )

EURDFWKXw.
Writes international date values as the name of the day and date in the form day-of-week, dd month-name yy (or yyyy)

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

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

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

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

MINGUOw.
Writes date values as Taiwanese dates in the form yyymmdd

MMDDYYw.
Writes date values in the form mmddyy or mmddyyyy

MMDDYYxw.
Writes date values in the form mmddyy or mmddyyyy with a specified separator

MMSSw.d
Writes time values as the number of minutes and seconds since midnight

MMYYxw.
Writes date values as the month and the year and separates them with a character

MONNAMEw.
Writes date values as the name of the month

MONTHw.
Writes date values as the month of the year

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

NENGOw.
Writes date values as Japanese dates in the form e.yymmdd

PDJULGw.
Writes packed Julian date values in the hexadecimal format yyyydddF for IBM

PDJULIw.
Writes packed Julian date values in the hexadecimal format ccyydddF for IBM

QTRw.
Writes date values as the quarter of the year

QTRRw.
Writes date values as the quarter of the year in Roman numerals

TIMEw.d
Writes time values as hours, minutes, and seconds in the form hh:mm:ss.ss

TIMEAMPMw.d
Writes time values as hours, minutes, and seconds in the form hh:mm:ss.ss with AM or PM

TODw.d
Writes the time portion of datetime values in the form hh:mm:ss.ss

WEEKDATEw.
Writes date values as the day of the week and the date in the form day-of-week, month-name dd, yy (or yyyy)

WEEKDATXw.
Writes date values as day of week and date in the form day-of-week, dd month-name yy (or yyyy)

WEEKDAYw.
Writes date values as the day of the week

WORDDATEw.
Writes date values as the name of the month, the day, and the year in the form month-name dd, yyyy

WORDDATXw.
Writes date values as the day, the name of the month, and the year in the form dd month-name yyyy

YEARw.
Writes date values as the year

YYMMxw.
Writes date values as the year and month and separates them with a character

YYMMDDw.
Writes date values in the form yymmdd or yyyymmdd

YYMMDDxw.
Writes date values in the form yymmdd or yyyymmdd with a specified separator

YYMONw.
Writes date values as the year and the month abbreviation

YYQxw.
Writes date values as the year and the quarter and separates them with a character

YYQRxw.
Writes date values as the year and the quarter in Roman numerals and separates them with characters
Numeric BESTw.
SAS chooses the best notation

BINARYw.
Converts numeric values to binary representation

COMMAw.d
Writes numeric values with commas and decimal points

COMMAXw.d
Writes numeric values with periods and commas

Dw.s
Prints variables, possibly with a great range of values, lining up decimal places for values of similar magnitude

DOLLARw.d
Writes numeric values with dollar signs, commas, and decimal points

DOLLARXw.d
Writes numeric values with dollar signs, periods, and commas

Ew.
Writes numeric values in scientific notation

FLOATw.d
Generates a native single-precision, floating-point value by multiplying a number by 10 raised to the dth power

FRACTw.
Converts numeric values to fractions

HEXw.
Converts real binary (floating-point) values to hexadecimal representation

IBw.d
Writes native integer binary (fixed-point) values, including negative values

IBRw.d
Writes integer binary (fixed-point) values in Intel and DEC formats

IEEEw.d
Generates an IEEE floating-point value by multiplying a number by 10 raised to the dth power

NEGPARENw.d
Writes negative numeric values in parentheses

NUMXw.d
Writes numeric values with a comma in place of the decimal point

OCTALw.
Converts numeric values to octal representation

PDw.d
Writes data in packed decimal format

PERCENTw.d
Writes numeric values as percentages

PIBw.d
Writes positive integer binary (fixed-point) values

PIBRw.d
Writes positive integer binary (fixed-point) values in Intel and DEC formats

PKw.d
Writes data in unsigned packed decimal format

PVALUEw.d
Writes p-values

RBw.d
Writes real binary data (floating-point) in real binary format

ROMANw.
Writes numeric values as Roman numerals

SSNw.
Writes Social Security numbers

S370FFw.d
Writes native standard numeric data in IBM mainframe format

S370FIBw.d
Writes integer binary (fixed-point) values, including negative values, in IBM mainframe format

S370FIBUw.d
Writes unsigned integer binary (fixed-point) values in IBM mainframe format

S370FPDw.d
Writes packed decimal data in IBM mainframe format

S370FPDUw.d
Writes unsigned packed decimal data in IBM mainframe format

S370FPIBw.d
Writes positive integer binary (fixed-point) values in IBM mainframe format

S370FRBw.d
Writes real binary (floating-point) data in IBM mainframe format

S370FZDw.d
Writes zoned decimal data in IBM mainframe format

S370FZDLw.d
Writes zoned decimal leading sign data in IBM mainframe format

S370FZDSw.d
Writes zoned decimal separate leading-sign data in IBM mainframe format

S370FZDTw.d
Writes zoned decimal separate trailing-sign data in IBM mainframe format

S370FZDUw.d
Writes unsigned zoned decimal data in IBM mainframe format

w.d
Writes standard numeric data one digit per byte

WORDFw.
Writes numeric values as words with fractions that are shown numerically

WORDSw.
Writes numeric values as words

YENw.d
Writes numeric values with yen signs, commas, and decimal points

Zw.d
Writes standard numeric data with leading 0s

ZDw.d
Writes numeric data in zoned decimal format


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.