SECS returns a FLOAT BINARY(53) value that is the number of seconds (based on Lilian format) corresponding to the date d.
>>-SECS--+--------------------------+-------------------------->< '-(-+------------------+-)-' '-d--+-----------+-' '-,p-+----+-' '-,w-'
d must have a computational type and should have character type. If not, it is converted to character.
p must have a computational type and should have character type. If not, it is converted to character.
The allowed patterns are listed in Table 2. For an explanation of Lilian format, see Date/time built-in functions.
dcl Dayname (7) char(9) var
static nonasgn init( 'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday');
dcl Jul4_1776_Secs float bin(53);
dcl Age_Tot_Secs pic 'Z,ZZZ,ZZZ,ZZZ,ZZ9';
Jul4_1776_Secs = secs('17760704','YYYYMMDD'); /* seconds */
Age_Tot_Secs = secs() - Jul4_1776_Secs; /* seconds since */
display ('USA became independent on ' ∥
dayname(weekday(secstodays(Jul4_1776_Secs))) ∥
', July 4, 1776 and at this very moment it has been ' ∥
Age_Tot_Secs, ∥ ' seconds.');