The FLD call is used to verify and to update the contents of one or more fields
in
an MSDB segment. Individual field verification or change specifications are specified
in field search arguments
(FSAs). (The format and use of FSAs are described in
the IBM publication IMS/ESA: Application Programming: EXEC DLI Commands for CICS
and IMS.) FSAs are passed to DL/I in the I/O area. Therefore, in the IMS DATA step interface, the PUT statement is used to format
the FSAs in the output buffer and
to execute the FLD call.
Like any
DL/I call, the FLD call returns a
status code. In addition, DL/I returns abnormal status information for each FSA in the call.
If a non-blank status
code is returned from a FLD call, it might be necessary to examine the contents of
the FSA return codes. The DL/I INFILE statement option FSARC= specifies a 200-byte
character
variable to which the first 200 FSA status code bytes can be returned.
The following example
issues a FLD call against an MSDB called INVNTORY:
ssa1='PRODUCT (PRODUCT = LOCKS )';
infile msdbpsb dli call=cfunc dbname=database
ssa=ssa1 fsarc=fsa_rc;
file msdbpsb dli;
cfunc = 'FLD ';
database = 'INVNTORY';
put @1 'QUANTITY H100*QUANTITY -100*ORDERS +1 ';
The call accesses a segment called PRODUCT containing data on locks. The FLD call
performs these functions:
-
verifies that the QUANTITY field is greater than 100
-
updates the QUANTITY field by subtracting 100 from its current value
-
updates the ORDERS field by adding 1 to its value.
If the QUANTITY field value is not greater than 100 when the FLD call is executed,
the
return code for the first FSA contains a D. The following statements check for errors in the
call and print an appropriate message on the SAS log for this error:
if _error_ then do;
file log;
if substr(fsa_rc,1,1) = 'D'
then put / '*** Quantity of Product Locks Less
Than 100 ***';
put _all_;
_error_=0;
end;