Checking the contents of a field: FLD/VERIFY
A FLD/VERIFY
call compares the contents of a specified field in a
segment to the value that you supply. The way that a FLD/VERIFY
call compares the
two depends on the operator you supply.
When you supply the name of a field and a value for comparison, you can determine if the value in the field is:
- Equal to the value you have supplied
- Greater than the value you have supplied
- Greater than or equal to the value you have supplied
- Less than the value you have supplied
- Less than or equal to the value you have supplied
- Not equal to the value you have supplied
After IMS performs the comparison that you have asked for, it returns a status code (in addition to the status code in the PCB) to tell you the results of the comparison.
If failures occur during processing of the FLD call, IMS reprocesses the call only if the failures are caused by deadlocks or verification errors. For other types of failures, abend U0819 is issued.
You specify the name of the field and the value that you want its value compared to in a field
search argument, or FSA. The FSA is also where IMS returns the
status code. You place the FSA in an I/O area before you issue a FLD
call, and then
you reference that I/O area in the call—just as you do for an SSA in a DL/I call. An FSA is similar
to an SSA in that you use it to give information to IMS about
the information you want to retrieve from the database. An FSA, however, contains more information
than an SSA. The table below shows the structure and format of an FSA.
FSA Component | Field Length |
---|---|
FLD NAME | 8 |
SC | 1 |
OP | 1 |
FLD VALUE | Variable |
CON | 1 |
- Field Name (FLD Name)
- This is the name of the field that you want to update. The field must be defined in the DBD.
- Status Code (SC)
- This is where IMS returns the status code for this FSA. If IMS successfully processes the FSA, it returns a blank status code. If IMS fails to process the FSA, it returns a FE status code to the
PCB to indicate a nonblank status code in the FSA and returns a nonblank FSA status code. The FSA
status codes that IMS might return to you on a
FLD/VERIFY
call are:- B
- The length of the data supplied in the field value is invalid, or the segment length of the data in the database is too small to contain the field length specified in the DBD.
- D
- The verify check is unsuccessful. In other words, the answer to your query is no.
- E
- The field value contains invalid data. The data you supplied in this field is not the same type of data that is defined for this field in the DBD.
- H
- The requested field is not found in the segment.
- Operator (OP)
- This tells IMS how you want
the two values compared. For a
FLD/VERIFY
call, you can specify:- E
- Verify that the value in the field is equal to the value you have supplied in the FSA.
- G
- Verify that the value in the field is greater than the value you have supplied in the FSA.
- H
- Verify that the value in the field is greater than or equal to the value you have supplied in the FSA.
- L
- Verify that the value in the field is less than the value you have supplied in the FSA.
- M
- Verify that the value in the field is less than or equal to the value you have supplied in the FSA.
- N
- Verify that the value in the field is not equal to the value you have supplied in the FSA.
- Field Value (FLD Value)
- This area contains the value that
you want IMS to compare to the value in the segment field. The
data that you supply in this area must be the same type of data in the field you have named in the
first field of the FSA. The five types of data are: hexadecimal, packed decimal, alphanumeric (or a
combination of data types), binary fullword, and binary halfword. The length of the data in this
area must be the same as the length that is defined for this field in the DBD.
Exceptions:
- If you are processing hexadecimal data, the data in the FSA must be in hexadecimal. This means that the length of the data in the FSA is twice the length of the data in the field in the database. IMS checks the characters in hexadecimal fields for validity before that data is translated to database format. (Only 0 to 9 and A to F are valid characters.)
- For packed-decimal data, you do not need to supply the leading zeros in the field value. This means that the number of digits in the FSA might be less than the number of digits in the corresponding database field. The data that you supply in this field must be in a valid packed-decimal format and must end in a sign digit.
When IMS processes the FSA, it does logical comparisons for alphanumeric and hexadecimal fields; it does arithmetic comparisons for packed decimal and binary fields.
- Connector (CON)
- If this is the only or last FSA in this call, this area contains a blank. If another FSA follows
this one, this area contains an asterisk (*). You can include several FSAs in one
FLD
call, if all the fields that the FSAs reference are in the same segment. If you get an error status code for aFLD
call, check the status codes for each of the FSAs in theFLD
call to determine where the error is.
When you have verified the contents of a field in the database, you can change the contents of that field in the same call. To do this, supply an FSA that specifies a change operation for that field.