File Utility Program (FUP) Management Programming Manual

ORSERV Programmatic Interface
File Utility Program (FUP) Management Programming Manual523322-001
4-7
Sending a Buffer to ORSERV (TAL Example)
Sending a Buffer to ORSERV (TAL Example)
Figure 4-3, TAL Procedure to Send a Buffer to ORSERV shows an example of a TAL
integer procedure that sends and receives an ORSERV command and response buffer
using the WRITEREAD procedure.
This example searches for a file-system error, verifies that it is an SPI buffer, and
checks if the entire buffer was read.
Note. For more information on creating checks, see Receiving and Decoding a Response
Buffer on page 4-13.
Figure 4-3. TAL Procedure to Send a Buffer to ORSERV (page 1 of 2)
! ---------------------------------------------------------
! Procedure SEND^COMMAND sends a command buffer to ORSERV
! using the WRITEREAD procedure. It then receives and
! checks the response buffer. The ORSERV process must
! already be created (with PROCESS_LAUNCH_ [NOWAIT]) and open.
! The buffer length must be a minimum ZORS^VAL^BUFLEN
! bytes. This procedure returns 0 if no errors occur, or
! an error number, if an error occurs.
! ---------------------------------------------------------
INT PROC send^command;
! ---------------------------------------------------------
! Global variables used are:
! STRUCT .buffer (ZORS^DDL^MSG^BUFFER^DEF);
! INT ORSERV^file^number,
! error, parameter^error, spi^error;
! ---------------------------------------------------------
BEGIN
! ---------------------------------------------------------
! Local definitions.
! ---------------------------------------------------------
INT .buffer^header (ZSPI^DDL^HEADER^DEF) = buffer;
INT used^length,
initial^buffer^position,
LITERAL buffer^error = 99;
! ---------------------------------------------------------
! Get the used length value and send the buffer to ORSERV.
! Then, check for a file-system error.
! ---------------------------------------------------------
CALL SSGETTKN (buffer,
ZSPI^TKN^USEDLEN,
used^length);