File Utility Program (FUP) Management Programming Manual

ORSERV Programmatic Interface
File Utility Program (FUP) Management Programming Manual523322-001
4-4
Communicating With ORSERV
8. Initialize and set the fields of structured tokens.
Call the SSNULL procedure to initialize the fields of each extensible structured
token to null values, then set the individual fields of each structured token.
9. Add the tokens to the buffer.
Call the SSPUT procedure for each token that you want put in the buffer. Specify
the command buffer, the unique token code, and a token value for each token.
SSPUT places the token values in the buffer.
10. Send the buffer.
Send the command buffer to ORSERV with the procedure that is appropriate for
the language you are using (such as WRITEREAD for TAL, READ WITH PROMPT
for COBOL85, or an #APPENDV/#REPLYV loop for TACL).
Although ORSERV accepts only one ONLINERELOAD, STATUS, or SUSPEND
command from an application, it can execute a GETVERSION command before it
uses one of them.
Check for any file-system errors after you send the command buffer to ORSERV.
File-system errors associated with applications using SPI include:
After ORSERV receives the buffer, it interprets the command request, executes the
command (if no errors exist in the command format), and returns a response in the
buffer (including any execution errors).
11. Interpret the response buffer from ORSERV.
After ORSERV returns the response buffer, call the SSGET procedure to retrieve
the tokens (including any error tokens) from the buffer. You must call SSGET to get
each token in the buffer.
12. Take the appropriate action.
Decide what to do after checking the ORSERV reply in the response buffer. If
ORSERV returned an error, execute an error-handling routine.
13. Close ORSERV.
Call the CLOSE file-system procedure to stop communicating with ORSERV.
ORSERV stops after you close it, unless it is executing a RELOAD, in which case it
stops after it completes the RELOAD. Before you close ORSERV, consider:
ONLINERELOAD command
The reload operation is started, and it returns the response buffer when you
send an ONLINERELOAD command. If reload errors occur, ORSERV writes
them to the ZZRELOAD file. To read the ZZRELOAD file and check the status
Error 2 The request is not a correctly formatted SPI buffer. This can happen if the
first two bytes do not contain -28.
Error 60 You did not open ORSERV before you sent the command buffer.