The MDYAMPM format does not display values properly when the width is less than 17


The MDYAMPM format does not display values properly when the format width is less than 17. Instead of writing as much of the datetime value as possible, zeros are written in the formatted value instead.

The sample code below illustrates the problem.

data _null_; a = DATETIME(); put a= MDYAMPM16.0; run;

a=0/0/0

The documentation states that the width range for the MDYAMPM format is 8-40. However, widths less than 17 do not produce the correct output.