Use this record-level keyword to allow your program to identify a record-by-record format when it issues a read-from-invited-devices operation using the name of the file. When you use an input operation, the OS/400 program compares data in the record received with the selection value specified in the parameter values. The selection value is that data beginning at the specified starting position must equal the specified compare value. Your program can then determine the record format of the data just read.
The format of the keyword is:
RECID(starting-position compare-value)
The starting-position parameter specifies a position relative to the start of the data in the buffer (disregarding indicators) to test for the record's ID. If the INDARA keyword is used, the start of data and buffer positions are the same. For a description of the buffer, see Figure 417. The position parameter can be either
nnnnn
or
*POSnnnnn
where nnnnn is a number that is one to five digits long. For example, the following are equivalent pairs:
1 and *POS1 34 and *POS34 12025 and *POS12025
The compare-value parameter can be one of the following:
A record format specifying the RECID keyword must contain at least one data field (usage of B).
You can specify the RECID keyword more than once in a record format. If you do so, data in the record is compared with each RECID keyword in the order specified until a match is found. The first record format whose selection value is satisfied by the data is the record format selected. If no match is found or no user data is received, the RECID default record format is used. The RECID default record format will be the first record format in the file that does not have the RECID keyword specified for it. However, if every record format in the file has the RECID keyword specified for it, the default record format will be the first record format in the file.
A message is issued to your program when data is received and no match is found and the RECID default record format has the RECID keyword specified for it.
When comparing the data received with the RECID keyword, if the position to be compared is beyond the last byte of data received, the data will be assumed to be blanks (hex 40).
This keyword is ignored at program run time unless the FMTSLT(*RECID) parameter is specified on the ADDICFDEVE, CHGICFDEVE, or OVRICFDEVE command.
You cannot specify RECID on the same record format as the VARBUFMGT keyword.
Option indicators are not valid for this keyword.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.