BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
michtka
Fluorite | Level 6

Hi everyone,

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

$10.

mmddyy10.

Cheers,

Jose.

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

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.

View solution in original post

3 REPLIES 3
art297
Opal | Level 21

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.

Ksharp
Super User

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

manojinpec
Obsidian | Level 7

$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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 4456 views
  • 0 likes
  • 4 in conversation