The DELETE SCRATCH statement deletes one scratch record or all records in the scratch area.
►►─── DELETE SCRATCH-─┬──────────────────────────────┬────────────────────────► └─ AREA ID (scratch-area-id ) ─┘ ►─┬─────────────────────────────────┬────────────────────────────────────────► ├─ CURRENT ───────────────────────┤ ├─ FIRST ─────────────────────────┤ ├─ LAST ──────────────────────────┤ ├─ NEXT ──────────────────────────┤ ├─ PRIOR ─────────────────────────┤ ├─ ALL ───────────────────────────┤ └─ RECORD ID (scratch-record-id) ─┘ ►─┬────────────────────────────────────────────────────┬─ ; ─────────────────►◄ └─ RETURN RECORD ID INTO (return-scratch-record-id) ─┘
Specifies the 1- to 8-character ID of the scratch area associated with the scratch records being deleted. Scratch-area-id is either the symbolic name of a user-defined field that contains the scratch area ID or the ID itself enclosed in single quotation marks. If the AREA ID parameter is not specified, the system assumes an area ID of 8 blanks.
Deletes the current record in the specified scratch area (that is, that record most recently referenced by another scratch function). CURRENT is the default.
Deletes the first record in the specified scratch area.
Deletes the last record in the specified scratch area.
Deletes the next record in the specified scratch area.
Deletes the prior record in the specified scratch area.
Deletes all records in the specified scratch area.
Deletes the record identified by scratch-record-id. Scratch-record-id is the symbolic name of a user-defined field that contains the ID.
Specifies the location in the program to which the system will return the ID of the last record deleted by means of the DELETE SCRATCH function. Return-scratch-record-id is the symbolic name of a user-defined 4-byte field.
The following statement deletes the scratch record that is prior to the current scratch record and returns the ID of the deleted record to the SCR_REC_ID field:
DELETE SCRATCH PRIOR RETURN RECORD ID INTO (SCR_REC_ID);
Upon completion of the DELETE SCRATCH function, the ERROR_STATUS field in the IDMS DC communications block indicates the outcome of the operation:
The request has been serviced successfully.
The requested scratch area ID cannot be found.
The requested scratch record ID cannot be found.
An I/O error has occurred during processing.
The parameter list is invalid.
|
Copyright © 2014 CA.
All rights reserved.
|
|