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

## Using FORMATS and INFORMAT of DATE VARIABLES

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

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.

Jonas V. Bilenas
1 ACCEPTED SOLUTION

Accepted Solutions
Super User

## Re: Using FORMATS and INFORMAT of DATE VARIABLES

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.

5 REPLIES 5
Super User

## Re: Using FORMATS and INFORMAT of DATE VARIABLES

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.

Obsidian | Level 7

## Re: Using FORMATS and INFORMAT of DATE VARIABLES

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
Obsidian | Level 7

## Re: Using FORMATS and INFORMAT of DATE VARIABLES solution as an attached document to open here.

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
Super User

## Re: Using FORMATS and INFORMAT of DATE VARIABLES

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.

Obsidian | Level 7

## Re: Using FORMATS and INFORMAT of DATE VARIABLES

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