Question

How can I turn data like 01JAN14:00:03:05 into JAN14 in a data step? I tried this but it's not working:

format ANOMES monyy7.;

but it returns 1.704E9...

Also I would need to know how to compare, for example: in a proc sql:

sum(case when anomes='jan14' then 1 else 0 end)

is not working, I get: "Expression using equals (=) has components that are of different data types."

and also the > and <.

thanks!

Was it helpful?

Solution

That's actually DATETIME to DATE.

In SAS, DATETIME is number of seconds since 1/1/1960 00:00:00. DATE is number of days since then. As such they have very different numeric representations.

If you need it displayed as such, you can use the DTMONYY format, like so.

format ANOMES dtmonyy7.;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top