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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.