File Utility Program (FUP) Management Programming Manual

FUP Programmatic Interface
File Utility Program (FUP) Management Programming Manual523322-001
2-4
Communicating With FUP
6. Initialize the command buffer.
Call the SSINIT procedure to specify the FUP command and initialize the buffer
(including the addition of header tokens).
7. 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.
8. Add the tokens to the buffer.
Call the SSPUT procedure for each token that you want to 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.
9. Send the buffer.
Send the command buffer to FUP 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). If you have opened FUP
for NOWAIT I/O, FUP accepts only one NOWAIT I/O operation.
After you send the command buffer to FUP, check for file-system errors. File-
system errors associated with applications using SPI include:
After FUP 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).
10. Interpret the response buffer from FUP.
After FUP returns the response buffer, call the SSGET procedure to retrieve the
tokens (including any error tokens) from the buffer. You must call SSGET for each
token in the buffer.
11. Take the appropriate action.
Decide what to do after checking the FUP reply in the response buffer. If FUP
returned an error, execute an error-handling routine.
12. If the context token (ZSPI-TKN-CONTEXT) is present in the response record
buffer, rebuild the buffer with this token and return to Step 9.
13. Check for another command request.
If you need to send another command request to FUP, see Step 6.
14. Close FUP. (You can close FUP when you do not have any additional command
requests. The FUP process stops when you close it.)
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 FUP before you sent the command buffer.