z/OS ISPF Services Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


TBEXIST—determine whether a row exists in a table

z/OS ISPF Services Guide
SC19-3626-00

The TBEXIST service tests for the existence of a specific row in a table with keys.

The current contents of the key variables, dialog variables that correspond to keys in the table, are used to search the table for the row.

This service is not valid for non-keyed tables and causes the current row pointer (CRP) to be set to the top.

Command invocation format

Read syntax diagramSkip visual syntax diagram
>>-ISPEXEC--TBEXIST--table-name--------------------------------><

Call invocation format

Read syntax diagramSkip visual syntax diagram
>>-CALL--ISPEXEC--(buf-len,--buffer);--------------------------><

or

Read syntax diagramSkip visual syntax diagram
>>-CALL--ISPLINK--('TBEXISTb'--,--table-name);-----------------><

Parameters

table-name
Specifies the name of the table to be searched.
buf-len
Specifies a fullword fixed binary integer containing the length of "buffer".
buffer
Specifies a buffer containing the name of the service and its parameters in the same form as they would appear in an ISPEXEC call for a command procedure.

Return codes

These return codes are possible:
 0
Normal completion; the CRP is positioned to the specified row.
 8
Keyed tables: the specified row does not exist; the CRP is set to TOP (zero).

Non-keyed tables: service not possible; the CRP is set to TOP.

12
Table is not open.
20
Severe error.

Example

In the keyed table TELBOOK, test for the existence of a row having a specific key value.
ISPEXEC TBEXIST TELBOOK
If return code = 0, the row exists.
Set the program variable BUFFER to contain:
TBEXIST TELBOOK
Set program variable BUFLEN to the length of the variable BUFFER. Issue the following command:
CALL ISPEXEC (BUFLEN, BUFFER);
If return code = 0, the row exists.

or alternately

CALL ISPLINK ('TBEXIST ','TELBOOK ');
If return code = 0, the row exists.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014