18.08.2013 Views

(SYSLIB) Programming Reference Manual - Public Support Login ...

(SYSLIB) Programming Reference Manual - Public Support Login ...

(SYSLIB) Programming Reference Manual - Public Support Login ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SFDT$–System Standard Format Date and Time<br />

SFDT_ERROR_CODE<br />

22.2.3. Example<br />

Negative error code if an error occurs:<br />

1 The buffer length is too short for specified format(s).<br />

2 The date-format index is out of range.<br />

3 The time-format index is out of range.<br />

4 Both date and time formats are zero.<br />

5 An outdated version of the SFDT$ packet is being used.<br />

The following example calls the relocatable version of SFDT$ from a PLUS program to<br />

return the date and time as an ASCII character string.<br />

module;<br />

copy ( ‘sfdt$dg’ );<br />

declare line: sfdt_buffer;<br />

declare pkt: sfdt_packet;<br />

sfdt_initialize ( %pkt, 8, 3, s’space’, 0, 7, loc( line ), -1, -1 );<br />

standard_date_time ( %pkt );<br />

open file ‘sysprint’ stream output;<br />

put file ‘sysprint’ edit ( line ) ( skip, a(28), skip );<br />

close file ‘sysprint’ ;<br />

term<br />

This will store the ASCII string for date format 8 and time format 2, which are separated<br />

by a space. These formats start in Q3 of the first word using current date and time in<br />

the buffer DATE_AND_TIME_LINE. They are six words long.<br />

22.3. SFDTBL$–Month and Day Table<br />

SFDTBL$ is a table of three ASCII character abbreviations for the months of the year and<br />

days of the week. SFDTBL$ is used by the standard date/time routines as a separate<br />

element. The ASCII characters can then be changed easily to incorporate user-defined<br />

abbreviations. Each abbreviation uses one word of storage, with a blank as the fourth<br />

character of the word.<br />

22–12 7833 1733–004

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!