COMPARE DATA statement

The COMPARE DATA statement is optional. It compares the segment returned by IMS to the data in the statement to verify that the correct segment was retrieved.

The following table gives the format of the COMPARE DATA statement.

Table 1. COMPARE DATA statement
Column Function Code Description
1 Identifies control statement E COMPARE statement.
2 Reserved b  
3 Length comparison option b For fixed-length segments or if the LL field of the segment is not included in the comparison; only the data is compared.
    L The length in columns 5-8 is converted to binary and compared against the LL field of the segment.
4 Segment length option b  
    V For a variable-length segment only, or for the first variable-length segment of multiple variable-length segments in a path call, or for a concatenated logical-child–logical-parent segment.
    M For the second or subsequent variable-length segment of a path call, or for a concatenated logical-child–logical-parent segment.
    P For fixed-length segments in path calls.
    Z For message segment.
5-8 Comparison length nnnn Length to be used for comparison. (Required for length options V, M, and P if L is coded in column 3.)
9 Reserved b  
10-13 Identifies type of statement DATA Required for the first I/O COMPARE statement and the first statement of a new segment if data from previous I/O COMPARE statement is not continued.
14-15 Reserved b  
16-71 String of data   Data against which the segment in the I/O area is to be compared.
72 Continuation column b If blank, data is NOT continued.
    x If not blank, data will be continued, starting in columns 16-71 of the subsequent statements for a maximum of 3840 bytes.
73-80 Sequence indication nnnnnnnn For SYSIN2 statement override.
Notes:
  • If you code an L in column 3, the value in columns 5 through 8 is converted to binary and compared against the LL field of the returned segment. If you leave column 3 blank and the segment is not in a path call, then the value in columns 5 through 8 is used as the length of the comparison.
  • If you code column 4 with a V, P, or M, you must enter a value in columns 5 through 8.
  • If this is a path call comparison, code a P in column 4. The value in columns 5 through 8 must be the exact length of the fixed segment used in the path call.
  • If you specify the length of the segment, this length is used in the COMPARE and in the display. If you do not specify a length, DFSDDLT0 uses the shorter value for the length of the comparison and display of:
    • The length of data supplied in the I/O area by IMS
    • The number of DATA statements read times 56