Previous Page | Next Page

Formats

DTMONYYw. Format



Writes the date part of a datetime value as the month and year in the form mmmyy or mmmyyyy.
Category: Date and Time
Alignment: right

Syntax
Syntax Description
Details
Comparisons
Examples
See Also

Syntax

DTMONYYw.

Syntax Description

w

specifies the width of the output field.

Default: 5
Range: 5-7

Details

The DTMONYYw. format writes SAS datetime values in the form mmmyy or mmmyyyy, where

mmm

is the first three letters of the month name.

yy or yyyy

is a two-digit or four-digit integer that represents the year.


Comparisons

The DTMONYYw. format and the MONYYw. format are similar in that they both write date values. The difference is that DTMONYYw. expects a datetime value as input, and MONYYw. expects a SAS date value.


Examples

The example table uses as input the value 1476598132, which is the SAS datetime value that corresponds to October 16, 2006, at 06:08:52 a.m.

SAS Statement Results

----+----1
put date dtmonyy.;
OCT06
put date dtmonyy5.;
OCT06
put date dtmonyy6.;
 OCT06
put date dtmonyy7.;
OCT2006


See Also

Formats:

DATETIMEw.d Format

MONYYw. Format

Previous Page | Next Page | Top of Page