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 />

Initialization Procedure<br />

The calling program may use the following procedure to set these variables in the SFDT$<br />

packet:<br />

PROCEDURE SFDT_INITIALIZE(%PACKET: SFDT_PACKET,<br />

INIT_DATE_FORMAT: 6 BIT INTEGER,<br />

INIT_TIME_FORMAT: 6 BIT INTEGER,<br />

INIT_SEPARATOR: 6 BIT STATUS (S’SPACE’:0,<br />

S’DASH’:1),<br />

INIT_CHAR_OFFSET: 6 BIT INTEGER,<br />

INIT_BUFFER_LENGTH: 6 BIT INTEGER,<br />

INIT_BUFFER_ADDRESS: 36 BIT MACHINE POINTER,<br />

INIT_DATE: 36 BIT MACHINE LOGICAL,<br />

INIT_TIME: 36 BIT MACHINE LOGICAL);<br />

BEGIN<br />

PACKET.SFDT_DATE_FORMAT:= INIT_DATE_FORMAT;<br />

PACKET.SFDT_TIME_FORMAT:= INIT_TIME_FORMAT;<br />

PACKET.SFDT_SEPARATOR:= INIT_SEPARATOR;<br />

PACKET.SFDT_CHAR_OFFSET:= INIT_CHAR_OFFSET;<br />

PACKET.SFDT_BUFFER_LENGTH:= INIT_BUFFER_LENGTH;<br />

PACKET.SFDT_BUFFER_ADDRESS:= INIT_BUFFER_ADDRESS;<br />

PACKET.SFDT_DATE:= INIT_DATE;<br />

PACKET.SFDT_TIME:= INIT_TIME;<br />

PACKET.SFDT_PACKET_VERSION:= 1;<br />

END;<br />

The SFDT_INITIALIZE procedure is defined in a PLUS COPY element (see 22.2.2).<br />

For example, the following call will initialize the data entity 'pkt' for date format 4 and<br />

time format 2, which are separated by a dash.<br />

SFDT_INITIALIZE(%pkt,4,2,S’Dash’,0,5,LOC(buffer),TEST_DATE,-1);<br />

These formats start in Q1 of the first word of the buffer; the buffer length is five words<br />

and is stored in buffer using the date stored at TEST_DATE and the current time.<br />

Returns<br />

SFDT$ returns string length in SFDT_NUMBER_CHAR, the offset of the last character<br />

(0, 1, 2, or 3) in SFDT_CHAR_OFFSET, and the error code, if any, in<br />

SFDT_ERROR_CODE.<br />

22–10 7833 1733–004

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

Saved successfully!

Ooh no, something went wrong!