FLD call
The Field (FLD
) call is used to access
a field within a segment for MSDBs or DEDBs.
Format
Call Name | DB/DC | DBCTL | DCCTL | DB Batch | TM Batch | |
---|---|---|---|---|---|---|
For MSDB: | FLD | X | ||||
For DEDB: | FLD | X | X |
Parameters
- db pcb
- Specifies the DB PCB for the call. This parameter is an input and output parameter.
- aib
- Specifies the AIB for the call. This parameter is an input and
output parameter. These fields must be initialized in the AIB:
- AIBID
- Eye catcher. This 8-byte field must contain DFSAIBbb.
- AIBLEN
- AIB lengths. This field must contain the actual length of the AIB that the application program obtained.
- AIBRSNM1
- Resource name. This 8-byte, left-justified field must contain the name of a DB PCB.
- AIBOALEN
- I/O area length. This field must contain the length of the I/O area specified in the call list.
- i/o area
- Specifies your program's I/O area, which contains the field search argument (FSA) for this call. This parameter is an input parameter.
- ssa
- Specifies the SSA, if any, that you want to use in this call.
You can use up to 15 SSAs in this input parameter. The SSA that you
supply will point to those data areas that you have defined for the
call. This parameter is optional for the
FLD
call.
Usage
Use the FLD
call
to access and change the contents of a field within a segment.
The FLD
call
does two things for you: it compares the value of a field to the value
you supply (FLD/VERIFY
), and it changes the value
of the field in the way that you specify (FLD/CHANGE
).
All DL/I command codes are available to DEDBs, using the FLD
call. The
FLD
call formats for DEDBs are the same as for other DL/I calls. So, if your MSDBs
have been converted to DEDBs, you do not need to change application programs that use the
FLD
call.
You
can also use the FLD
call in application programs
for DEDBs, instead of the combination of GHU
, REPL
,
and DL/I
calls.
FSAs
The field search argument
(FSA) is equivalent to the I/O area that is used by other DL/I database
calls. For a FLD
call, data is not moved into the
I/O area; rather, the FSAs are moved into the I/O area.
Multiple
FSAs are allowed on one FLD
call. This is specified
in the FSA's connector field. Each FSA can operate on either the same
or different fields within the target segment.
FLD
call contains five fields.
The rules for coding these fields are as follows: - Field name
- This field must be 8 bytes long. If the field name you are using is less than 8 bytes, the name must be left-justified and padded on the right with blanks.
- FSA status code
- This field is 1 byte. After a
FLD
call, IMS returns one of these status codes to this area:- b
- Successful
- A
- Invalid operation
- B
- Operand length invalid
- C
- Invalid call—program tried to change key field
- D
- Verify check was unsuccessful
- E
- Packed decimal or hexadecimal field is invalid
- F
- Program tried to change an unowned segment
- G
- Arithmetic overflow
- H
- Field not found in segment
- Op code
- This 1-byte field contains one of these operators for a change
operation:
- +
- To add the operand to the field value
- -
- To subtract the operand from the field value
- =
- To set the field value to the value of the operand
- E
- Verify that the field value and the operand are equal.
- G
- Verify that the field value is greater than the operand.
- H
- Verify that the field value is greater than or equal to the operand.
- L
- Verify that the field value is less than the operand.
- M
- Verify that the field value is less than or equal to the operand.
- N
- Verify that the field value is not equal to the operand.
- Operand
- This variable length field contains the value that you want to test the field value against. The data in this field must be the same type as the data in the segment field. (You define this in the DBD.) If the data is hexadecimal, the value in the operand is twice as long as the field in the database. If the data is packed decimal, the operand does not contain leading zeros, so the operand length might be shorter than the actual field. For other types of data, the lengths must be equal.
- Connector
- This 1-byte field must contain a blank if this is the last or only FSA, or an asterisk (*) if another FSA follows this one.
The format of SSA in FLD
calls
is the same as the format of SSA in DL/I calls. If no SSA exists,
the first segment in the MSDB or DEDB is retrieved.