Write and run SAS programs in your web browser

change date format in a column

Accepted Solution Solved
Reply
Contributor
Posts: 23
Accepted Solution

change date format in a column

Hi, I have a column DATE, type Numeric and Format MMDDYY10. 

 

I need to show that dates in numbers since 1/1/1960 (original SAS format). 

 

Thanks


Accepted Solutions
Solution
‎10-08-2016 02:22 PM
Contributor
Posts: 23

Re: change date format in a column

Here is the solution:

 

proc sql;

ALTER TABLE WORK.TABLE1

  MODIFY varialbe_data FORMAT=null.;

quit;

run;

View solution in original post


All Replies
Super User
Posts: 7,405

Re: change date format in a column

Just assign a standard numeric format, like 5..

Or use the format in a put statement or put() function.

 

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Solution
‎10-08-2016 02:22 PM
Contributor
Posts: 23

Re: change date format in a column

Here is the solution:

 

proc sql;

ALTER TABLE WORK.TABLE1

  MODIFY varialbe_data FORMAT=null.;

quit;

run;

Super User
Posts: 19,051

Re: change date format in a column

Null. Isn't a default SAS format. 

 

Changing the format is correct, but if it's a SAS dataset I'd recommend 8. instead. 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 523 views
  • 0 likes
  • 3 in conversation