DELETE

Delete resource table records.

Read syntax diagramSkip visual syntax diagramDELETECURRENTALLFILTER(cpsm-token)MARKEDNOTFILTER(cpsm-token)NOTMARKEDCOUNT(data-ref)RESULT(cpsm-token )THREAD(cpsm-token )RESPONSE(data-ref )REASON(data-ref )

Description

This command deletes one or more resource table records from a result set.
  • The DELETE command always begins processing with the last record that was fetched, rather than the next one in the result set.
  • The records you delete are marked as deleted, but they retain their positions in the result set. The remaining records also retain their positions; they are not renumbered. Any API commands that you issue after a DELETE command skip over the deleted records in a result set. One exception is the ORDER command, which sorts all the records in a result set, including deleted records. If you try to issue a command against a deleted record, you receive a RESPONSE value of NODATA.
  • To remove deleted records and compress a result set, you can copy the remaining records to a new result set. Use the COPY command with the ALL option to copy all the records in a result set except those that have been deleted.
    Note: Deleted records are also removed and the remaining records renumbered when you issue a REFRESH command.

Related commands

COPY, DISCARD, GET, GROUP, LOCATE, MARK, ORDER, PERFORM OBJECT, REFRESH, SPECIFY FILTER

Options

ALL
Deletes all the resource table records in the result set.
COUNT(data-ref)
Names a variable to receive the number of resource table records in the result set after the delete process is complete.
CURRENT
Deletes only the current resource table record in the result set.
Note: The record pointer remains positioned on the deleted record. If you issue another API command with the CURRENT option before repositioning the pointer, you receive a RESPONSE value of NODATA.
FILTER(cpsm-token)
Identifies a filter to be used for this operation. The FILTER option deletes only those resource table records that meet the specified filter criteria.

The cpsm-token value that identifies a filter is returned by the SPECIFY FILTER command.

MARKED
Deletes only those resource table records that are marked in the result set. You can mark resource table records by using the MARK and UNMARK commands.
NOTFILTER(cpsm-token)
Identifies a filter to be used for this operation. The NOTFILTER option deletes only those resource table records that do not meet the specified filter criteria.

The cpsm-token value that identifies a filter is returned by the SPECIFY FILTER command.

NOTMARKED
Deletes only those resource table records that are not marked in the result set. You can mark resource table records by using the MARK and UNMARK commands.
REASON(data-ref)
Names a variable to receive the fullword reason value returned by this command.
RESPONSE(data-ref)
Names a variable to receive the fullword response value returned by this command.
RESULT(cpsm-token)
Identifies the API result set to be processed by this operation. The result set can be one produced by any of these commands:
  • COPY
  • GET
  • GROUP
  • PERFORM OBJECT.
THREAD(cpsm-token)
Identifies the API thread to be used for this operation. The cpsm-token value that identifies a thread is returned by the CONNECT command.

Conditions

The following is a list of the RESPONSE values that can be returned by the DELETE command. The description of each RESPONSE includes a list of associated REASON values, if appropriate.
OK
The command completed processing successfully.
NODATA
No records were found that matched the specified search criteria.
BUSY
A busy condition occurred for the following reason:
RESULT
The result set specified on the RESULT option is being processed by another command.
ENVIRONERROR
An environment error occurred for one of the following reasons:
NOSERVICE
The application stub program could not load the API service module.
NOSTORAGE
The application stub program could not obtain the necessary storage in the address space where the processing thread is running.
SOCRESOURCE
A required resource that is owned by the CMAS is not available.
SOLRESOURCE
A required resource that is locally owned (that is, owned by the address space where the processing thread is running) is not available.
FAILED
The command failed for one of the following reasons:
ABENDED
Command processing abended.
EXCEPTION
Command processing encountered an exceptional condition.
INVALIDPARM
An invalid parameter was detected. The parameter that is invalid is returned as the reason value:
  • FILTER
  • NOTFILTER
  • RESULT
  • THREAD.
Check the command description for valid parameter syntax.
NOTAVAILABLE
A not available condition occurred for one of the following reasons:
APITASK
The API control subtask is not active.
CPSMAPI
The CMAS to which the processing thread is connected is not available for API processing.
SERVERGONE
The CMAS to which the processing thread was connected is no longer active.
VERSIONINVL
A version conflict occurred for one of the following reasons:
NOTSUPPORTED
The version of the application stub program used for this command is not supported.
NOTVSNCONN
The version of the application stub program used for this command is not the same as the version used with the CONNECT command.