The current documentation on the picture format seems to imply that we should use both the %S and the %s directives in order to display the seconds and the fractional seconds. From what I see (in SAS version 9.04.01 M4) we should use only the %s directive by itself. It displays both the full and the fractional seconds.
Example:
proc format;
picture fm_db2_date_time (default=26)
other = '%Y-%0m-%0d %0H:%0M:%000000s' (datatype=datetime)
;
run;
proc sql;
select dhms('01may2012'd,13,5,2.876543) format=datetime26.6 'built-in format'
,dhms('01may2012'd,13,5,2.876543) format=fm_db2_date_time26.6 'picture format'
from sashelp.class(obs=1)
;quit;
I wanted to submit a request for a usage note, but I couldn't find how to do that.
@agoldma for something like this you can either contact tech support or post on SASware Ballot section where it can be voted on.
https://communities.sas.com/t5/SASware-Ballot-Ideas/idb-p/sas_ideas
Some of the behavior differences are more obvious when you do not provide the w.d at use.
Such as:
proc format library=work; picture fm_db2_me (default=26) other = '%Y-%0m-%0d %0H:%0M:%0S.%s' (datatype=datetime) ; picture fm_db2_date_time (default=26) other = '%Y-%0m-%0d %0H:%0M:%000000s' (datatype=datetime) ; run; data _null_; x='01may2012:13:05:02.1234567'dt; put "datetime format " @25 x= datetime. ; put "fm_db2_date_time format " @25 x= fm_db2_date_time. ; put "fm_db2_me format " @25 x=fm_db2_me.; run;
where the format with %0S and %s shows a different number of displayed characters even though it has the same default length.
@agoldma for something like this you can either contact tech support or post on SASware Ballot section where it can be voted on.
https://communities.sas.com/t5/SASware-Ballot-Ideas/idb-p/sas_ideas
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.