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
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for 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.