07-19-2016 03:57 AM
I need to know if there is a specific format that can write out to a file the date format as shown below... please take note of the case. 30Apr2016:00:00:00
07-19-2016 04:13 AM
Have you looked through the documentation:
I would think that datetime18. would work.
07-19-2016 04:41 AM
I have tried so many thing enough to even think it is not possible with SAS.
Your suggestion does not address the case variation on month abbreviation.
Does this mean its not possible with SAS?
07-21-2016 09:03 PM
07-20-2016 07:01 AM - edited 07-20-2016 07:03 AM
From what I can see Proc Format Picture datetime directives don't allow you to specify the casing. The same is true with OOB formats.
It's ridiculously complicated but I believe the only way how you can define the format exactly how you want it, is by calling a function within the format. Below code does what you're asking for (if it's justified doing it this way is another question).
proc fcmp outlib=work.funcs.test; function my_dt(in_dt) $ 18; out_dt=put(in_dt,datetime18.); out_dt=prxchange('s/([[:alpha:]])([[:alpha:]]+)/\u\1\L\2/oi',-1,out_dt); return(out_dt); endsub; run; options cmplib=work.funcs; proc format; value my_dt (default=18) other=[my_dt()] ; run; data have; format dt my_dt.; dt='30Apr2016:14:10:23'dt; run; proc print data=have; run;
07-21-2016 05:22 AM
"Don't you think it will raise perfomance issues?"
It won't perform as good as a "normal" format as there is a RegEx string operation in the function but I wouldn't expect a "massive" impact on performance.
Need further help from the community? Please ask a new question.