Hello, I am trying to create my own format using PROC FORMAT and apply this format to show the difference in days, hours, min, sec between two datetimes. The hours, minutes and seconds calculate perfectly but I can't seem to find any directive that will display the number of days correctly. If anyone could help me figure this out, I would really appreciate it. Here's my code: PROC FORMAT; PICTURE Diff_Format LOW-HIGH = '%N days, %H hrs, %M min, %S sec' (DATATYPE=DATETIME); QUIT; data _null_; StartDate = '15APR2015:15:23:32'dt; EndDate = '18APR2015:16:44:56'dt; Difference = EndDate - StartDate; /* Calculating the difference */ PUT Difference = Diff_Format.; RUN; The answer should be -> Difference=03 days, 1 hrs, 21 min, 24 sec But this code yields -> Difference=01 days, 1 hrs, 21 min, 24 sec
... View more