Page History
7.59 FETCH
| Note | ||
|---|---|---|
| title | Note: | Usage options |
The FETCH command is used to fetch fields from the first record in a file that matches a nominated key, condition or relative record number.
Also See
| Panel | ||
|---|---|---|
| ||
Required FETCH --- | ||
| Code Block | ||
| Required
FETCH -------- FIELDS ---------- field name field attributesfield name field attributes ------> | | | | | --- 7 max
1000 max for RDMLX----| -
100 max for RDML ------ >>-- FROM_FILE ------ file name . *FIRST ----------------> library name
--------------------------------------------------------------------- Optional >-- WHERE---- Optional >-- WHERE --------- 'condition' ------------------------> >>-- WITH_KEY ------ key field values -------------------> expandable group expression >-- IO_STATUS
>-- IO_STATUS ----- *STATUS ---------------------------> field name >--
>-- IO_ERROR ----- *ABORT ----------------------------> *NEXT *RETURN label >-- VAL_ERROR
>-- VAL_ERROR ---- *LASTDIS ---------------------------> *NEXT *RETURN label >-- NOT_FOUND ---- *NEXT
>-- NOT_FOUND -- *NEXT ------------------------------> *RETURN label >-- ISSUE_MSG
>-- ISSUE_MSG ---- *NO --------------------------------> *YES >-- LOCK
>-- LOCK ---------- *NO --------------------------------> *YES >--
>-- WITH_RRN ----- *NONE ------------------------------ > >> >-- RETURN_RRN -- -*NONE ------------------------------> >>-- KEEP_LAST ----- *NONE -------------------------------| 1 -
|