BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
jbilenas
Obsidian | Level 7

A SAS user asked in a SAS SLACK group, “I have a numeric value of 1686024000 and I need to change it to Datevalue”?

 

SAS SLACK group: https://app.slack.com/client/TA404MQKB/CA4L6S7SR/thread/CA4L6S7SR-1686075257.165029 

 

I solved the solution for the SAS user in my SAS Blog and also posted it in my LinkedIn Profile:

 

 

Jonas V. Bilenas

SASATICIAN since 1986 in the Banking Industry.

https://jonasbilenascom.wpcomstaging.com/ 

 

Jonas V. Bilenas
1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Is there a question there?

I would be interested in know what date the value 1,686,024,000 turned out to be.

But not interested enough to click on the links.

View solution in original post

5 REPLIES 5
Tom
Super User Tom
Super User

Is there a question there?

I would be interested in know what date the value 1,686,024,000 turned out to be.

But not interested enough to click on the links.

jbilenas
Obsidian | Level 7
OK. The Question was from a SAS User,

"“I have a numeric value of 1686024000 and I need to change it to Datevalue?”

He or She was using DATE FORMATS to convert the SAS date variable,1686024000, to a readable date. I will try to include my 6 page pdf solution.
Jonas V. Bilenas
jbilenas
Obsidian | Level 7

A SAS user would like to see my response here since the user did not want to click on the website links. I will attach the *.pdf file in this reply. 

 

 

 

Jonas V. Bilenas
Tom
Super User Tom
Super User

But what date value did they think that number represented?

It does not look like any digit string that would represent a date, so no need for any INFORMATs to convert strings into numbers.

 

It is clearly not a DATE value in SAS since that number of days would be past the year 5 million.

 

So perhaps they actually meant that they had a DATETIME value instead of DATE value.

 

In which case there is no need for 6 pages of PDF files.

700  data have ;
701    number=1686024000;
702    put number=datetime19. number=dtdate9.;
703  run;

number=05JUN2013:04:00:00 number=05JUN2013

 

If they thought it represented some other datetime value then perhaps it was using a different basis date than the 1960 that SAS uses.

jbilenas
Obsidian | Level 7
That is correct but typically in training at SAS USER CONFERENCES, college training and corporate training, I like to add more that the conclusion is clear.

Interesting that you were able to get the date without using DATEPART function to separate the date component from the time component.

Thanks for showing me the DTDATE FORMAT.

With SAS training you always learn new things of getting solutions.

I guess I got used to Ron Cody's SAS training sessions since 1989 at many SAS USER GROUP MEETINGS I attended (local, regional, and national). The live presentations were very entertaining and encouraging one to keep learning and using SAS,

Jonas V. Bilenas




Jonas V. Bilenas.
local
Jonas V. Bilenas

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 5 replies
  • 940 views
  • 1 like
  • 2 in conversation