Hi All,
I have a variable with numeric datetime, but i need to create a new variable character variable
Have:
subj stdt(numeric)
100 10OCT2013:12:15:32
want:
subj stdt(numeric) newvar
100 10OCT2013:12:15:32 10 OCT 2013
My try:
newvar=scan(put(stdt,datetime20.),1,':');
I got:
10OCT2013
but i want
10 OCT 2013
Thanks
Sam
data want;
set have;
newvar=catx(' ',day(datepart(stdt)),
upcase(put(month(datepart(stdt)),worddate3.)),
year(datepart(stdt)));
run;
data want;
set have;
newvar=catx(' ',day(datepart(stdt)),
upcase(put(month(datepart(stdt)),worddate3.)),
year(datepart(stdt)));
run;
Thank you Arthur !!! that is what exactly what i am looking for. I tried datepart but i was not succeed with month section.
I got error .. thank you today i know how to and where to use worddate3. format
Thanks
Sam
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.