Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,27 @@
/* Convert seconds to Compound Duration (weeks, days, hours, minutes, seconds). */
cvt: procedure options (main); /* 5 August 2015 */
declare interval float (15);
declare (unit, i, q controlled) fixed binary;
declare done bit (1) static initial ('0'b);
declare name (5) character (4) varying static initial (' wk', ' d', ' hr', ' min', ' sec' );
get (interval);
put edit (interval, ' seconds = ') (f(10), a);
if interval = 0 then do; put skip list ('0 sec'); stop; end;
do unit = 60, 60, 24, 7;
allocate q;
q = mod(interval, unit);
interval = interval / unit;
end;
allocate q; q = interval;
do i = 1 to 5;
if q > 0 then
do;
if done then put edit (', ') (a);
put edit (trim(q), name(i)) (a, a); done = '1'b;
end;
if i < 5 then free q;
end;
end cvt;