## format mmddyy10 \$10

Solved
Super Contributor
Posts: 301

# format mmddyy10 \$10

Hi everyone,

anyone can tell me the difference of these two formats for a character variable called date:

\$10.

mmddyy10.

Cheers,

Jose.

Accepted Solutions
Solution
‎03-10-2012 08:24 AM
PROC Star
Posts: 8,164

## format mmddyy10 \$10

mmddyy10. is a format that, when applied to a number, will display the number of days since Jan 1, 1960 that the number represents.  Thus, 2, would be displayed as Jan 2, 1960.

\$10. can only be applied to a string of characters and will simply display that string.  Thus if the string is the character that represents the number 2, it will be displayed as 2.

All Replies
Solution
‎03-10-2012 08:24 AM
PROC Star
Posts: 8,164

## format mmddyy10 \$10

mmddyy10. is a format that, when applied to a number, will display the number of days since Jan 1, 1960 that the number represents.  Thus, 2, would be displayed as Jan 2, 1960.

\$10. can only be applied to a string of characters and will simply display that string.  Thus if the string is the character that represents the number 2, it will be displayed as 2.

Super User
Posts: 10,778

## format mmddyy10 \$10

Actually 01jan1960 is 0 , 02jan1960 is 1.

22   data _null_;

23    do i=0 to 4;

24     put i date9.;

25    end;

26   run;

01JAN1960

02JAN1960

03JAN1960

04JAN1960

05JAN1960

Ksharp

Frequent Contributor
Posts: 139

## format mmddyy10 \$10

\$10. will be your date as character. you would not be able to do any date operations on this variable. However mmddyy10. is date which is numeric in nature.

🔒 This topic is solved and locked.