Writes SAS date values in the form mm[yy]yy or mmX[yy]yy. The x in the format name is a character that represents the special character. The special character separates the month and the year. That special character can be a hyphen (-), period (.), blank character, slash (/), colon (:), or no separator. The year can be either 2 or 4 digits.
Category: | Date and Time |
Alignment: | Right |
identifies a separator or specifies that no separator appear between the month and the year. Valid values for x are any of the following:
separates with a colon
separates with a hyphen
indicates no separator
separates with a period
separates with a forward slash.
specifies the width of the output field.
Default | 7 |
Range | 5–32 |
Interactions | When x is set to N, no separator is specified. The width range is then 4–32, and the default changes to 6. |
When x has a value of C, D, P, or S and w has a value of 5 or 6, the date appears with only the last two digits of the year. When w is 7 or more, the date appears with a four-digit year. | |
When x has a value of N and w has a value of 4 or 5, the date appears with only the last two digits of the year. When x has a value of N and w is 6 or more, the date appears with a four-digit year. |
Statements
|
Results
|
---|---|
|
----+----1----+ |
select put(19560,mmyyc5.); |
07:13 |
select put(19560,mmyyd7.); |
07-2013 |
select put(19560,mmyyn4.); |
0713 |
select put(19560,mmyyp8.); |
07.2013 |
select put(19560,mmyys10.); |
07/2013 |