converting format (from date to numeric) using SAS -


i working dataset in sas, containing many variables.

one of these variables date variable , has date/time format. looks this:

12feb97:00:00:00   27mar97:00:00:00   14apr97:00:00:00 

now thing convert variable numeric format. , following result (based on shown 3 examples):

199702   199703   199704   

do have ideas how it? read through many docs, pdfs etc. still not find proper solution yet.
thank much!

first, need extract date datetime variable. can use datepart function:

 date = datepart(var); 

then, want put variable (which still coded date number) number can read year , month. putn:

date_as_num = putn(date,'yymmn6.'); 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -