SPI Programming Manual (G06.24+, H06.03+, J06.03+)

The SPI Procedures
SPI Programming Manual427506-006
3-17
Special Operations With SSGET and SSGETTKN
Here SSGET or SSGETTKN returns, in ssid, INT .EXT:ref:6, the default subsystem
ID value at the current-token pointer. SSPUT, SSPUTTKN, SSGET, and SSGETTKN
use this value whenever the
ssid parameter is omitted or null.
If the default subsystem ID comes from a list token, then the version field of
ssid is
set to ZSPI-VAL-NULL-VERSION. Therefore, when comparing subsystem ID values
for equality, your program should omit the version field from the test.
ZSPI-TKN-HDRTYPE: Retrieve Header Type
Call SSGET or SSGETTKN with this token code to retrieve the header type from the
corresponding header token. If you specify an
index parameter, it must have a value
of 0 or 1.
ZSPI-TKN-LASTERR: Retrieve Last SPI Error Number
Call SSGET or SSGETTKN with this token code to retrieve, from the corresponding
header token, the error number returned by the last SPI procedure error. If you specify
an
index parameter, it must have a value of 0 or 1.
ZSPI-TKN-LASTERRCODE: Retrieve Token Code Involved in
Last SPI Error
Call SSGET or SSGETTKN with this token code to retrieve, from the corresponding
header token, the code of the token involved in the last SPI procedure error. If you
specify an
index parameter, it must have a value of 0 or 1.
ZSPI-TKN-LASTPOSITION: Retrieve Position of Last Token
Put in Buffer
Call SSGET or SSGETTKN with this token code to retrieve, from the corresponding
header token, the position where the last token was added by SSPUT(TKN). The value
returned is a 4-word position descriptor, INT.EXT:ref:4, that you can later use to reset
the position with the SSPUT or SSPUTTKN special operation ZSPI-TKN-POSITION. If
you specify an
index parameter, it must have a value of 0 or 1.
Saving the position of the last token is useful when you want to add a group of related
tokens for which the buffer might not have sufficient space. After adding the first of the
related tokens, call SSGET with ZSPI-TKN-LASTPOSITION to get the position of that
token. Then, if the buffer does not have space for the remaining related tokens, you
can use the saved position to remove the tokens following it. First, call SSPUT with
ZSPI-TKN-POSITION and the value returned by ZSPI-TKN-LASTPOSITION to set the
current-token pointer to the first of the related tokens. Second, call SSPUT with ZSPI-
TKN-DATA-FLUSH to remove the current token and all the tokens that follow.